forked from CGM_Public/pretix_original
Move static files out of pretix again, compile on setuptools build
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
include LICENSE
|
||||
include README.rst
|
||||
recursive-include pretix/static *
|
||||
recursive-include pretix/static.dist *
|
||||
recursive-include pretix/locale *
|
||||
recursive-include pretix/base/templates *
|
||||
recursive-include pretix/control/templates *
|
||||
|
||||
@@ -129,7 +129,7 @@ SESSION_COOKIE_DOMAIN = config.get('pretix', 'cookie_domain', fallback=None)
|
||||
|
||||
# Internal settings
|
||||
|
||||
STATIC_ROOT = '_static'
|
||||
STATIC_ROOT = os.path.join(os.path.dirname(__file__), 'static.dist')
|
||||
|
||||
SESSION_COOKIE_NAME = 'pretix_session'
|
||||
LANGUAGE_COOKIE_NAME = 'pretix_language'
|
||||
@@ -257,11 +257,11 @@ STATICFILES_FINDERS = (
|
||||
)
|
||||
|
||||
STATICFILES_DIRS = [
|
||||
os.path.join(os.path.dirname(__file__), 'static')
|
||||
os.path.join(BASE_DIR, 'static')
|
||||
]
|
||||
|
||||
if os.path.exists(os.path.join(DATA_DIR, 'static')):
|
||||
STATICFILES_DIRS.insert(0, os.path.join(DATA_DIR, 'static'))
|
||||
# if os.path.exists(os.path.join(DATA_DIR, 'static')):
|
||||
# STATICFILES_DIRS.insert(0, os.path.join(DATA_DIR, 'static'))
|
||||
|
||||
COMPRESS_PRECOMPILERS = (
|
||||
('text/less', 'pretix.helpers.lessabsolutefilter.LessFilter'),
|
||||
|
||||
25
src/setup.py
25
src/setup.py
@@ -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
|
||||
)
|
||||
|
||||
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 106 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user