fix plain tests
This commit is contained in:
parent
c768ef7a44
commit
ea2b7c1be4
@ -7,6 +7,17 @@ BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
_DEBUG = bool(environ.get('E11SYNC_DEBUG', False))
|
||||
_STATIC_ROOT = environ.get('E11SYNC_STATIC_ROOT', BASE_DIR / '_static')
|
||||
_GEOIP_PATH = environ.get('GEOIP_PATH')
|
||||
|
||||
_STATICFILES_STORAGE = environ.get('E11SYNC_STATICFILES', 'manifest')
|
||||
if _STATICFILES_STORAGE == 'manifest':
|
||||
_prefix = 'lib.staticfiles.'
|
||||
_STATICFILES_STORAGE_BACKEND = _prefix + 'ManifestStaticFilesStorageSha256'
|
||||
elif _STATICFILES_STORAGE == 'simple':
|
||||
_prefix = 'django.contrib.staticfiles.storage.'
|
||||
_STATICFILES_STORAGE_BACKEND = _prefix + 'StaticFilesStorage'
|
||||
else:
|
||||
raise Exception("E11SYNC_STATICFILES neither 'manifest' nor 'simple'")
|
||||
|
||||
if db := environ.get('E11SYNC_DATABASE_PATH'):
|
||||
_DATABASE_PATH = db
|
||||
else:
|
||||
@ -27,6 +38,7 @@ if not environ.get("E11SYNC_DEBUG_PRINTED"):
|
||||
print("STATIC_ROOT={}".format(_STATIC_ROOT))
|
||||
print("GEOIP_PATH={}".format(_GEOIP_PATH))
|
||||
print("DATABASE_PATH={}".format(_DATABASE_PATH))
|
||||
print("STATICFILES_STORAGE_BACKEND=" + _STATICFILES_STORAGE_BACKEND)
|
||||
environ["E11SYNC_DEBUG_PRINTED"] = "1"
|
||||
|
||||
#######################################
|
||||
@ -114,11 +126,7 @@ STATICFILES_FINDERS = [
|
||||
"django.contrib.staticfiles.finders.AppDirectoriesFinder",
|
||||
]
|
||||
|
||||
STORAGES = {
|
||||
"staticfiles": {
|
||||
"BACKEND": 'lib.staticfiles.ManifestStaticFilesStorageSha256'
|
||||
},
|
||||
}
|
||||
STORAGES = {"staticfiles": {"BACKEND": _STATICFILES_STORAGE_BACKEND}}
|
||||
|
||||
STATIC_ROOT = _STATIC_ROOT
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user