Move static files out of pretix again, compile on setuptools build

This commit is contained in:
Raphael Michel
2016-02-16 16:42:02 +01:00
parent abe89039e4
commit f503d3f3f5
399 changed files with 30 additions and 5 deletions
+25
View File
@@ -1,4 +1,6 @@
import os
from codecs import open
from distutils.command.build import build
from os import path
from setuptools import find_packages, setup
@@ -9,6 +11,28 @@ here = path.abspath(path.dirname(__file__))
with open(path.join(here, '../README.md'), encoding='utf-8') as f:
long_description = f.read()
class CustomBuild(build):
def run(self):
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pretix.settings")
import django
django.setup()
from django.conf import settings
from django.core import management
settings.COMPRESS_ENABLED = True
settings.COMPRESS_OFFLINE = True
management.call_command('collectstatic', verbosity=1, interactive=False)
management.call_command('compress', verbosity=1, interactive=False)
build.run(self)
cmdclass = {
'build': CustomBuild
}
setup(
name='pretix',
version='0.0.0',
@@ -52,4 +76,5 @@ setup(
packages=find_packages(exclude=['tests', 'tests.*']),
include_package_data=True,
cmdclass=cmdclass
)