Fix static files problem with correct whitenoise settings
This commit is contained in:
parent
9d0c41322c
commit
db78f1a9cf
|
|
@ -4,7 +4,7 @@ set -o errexit
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
set -o nounset
|
set -o nounset
|
||||||
|
|
||||||
python /app/manage.py collectstatic --no-input --no-post-process
|
# python /app/manage.py collectstatic --no-input --no-post-process
|
||||||
|
|
||||||
# TODO remove after stabilisation
|
# TODO remove after stabilisation
|
||||||
python /app/manage.py reset_schema
|
python /app/manage.py reset_schema
|
||||||
|
|
|
||||||
|
|
@ -619,6 +619,29 @@ if FILE_UPLOAD_STORAGE == "s3":
|
||||||
|
|
||||||
AWS_PRESIGNED_EXPIRY = env.int("AWS_PRESIGNED_EXPIRY", default=300) # seconds
|
AWS_PRESIGNED_EXPIRY = env.int("AWS_PRESIGNED_EXPIRY", default=300) # seconds
|
||||||
|
|
||||||
|
WHITENOISE_SKIP_COMPRESS_EXTENSIONS = (
|
||||||
|
"jpg",
|
||||||
|
"jpeg",
|
||||||
|
"png",
|
||||||
|
"gif",
|
||||||
|
"webp",
|
||||||
|
"zip",
|
||||||
|
"gz",
|
||||||
|
"tgz",
|
||||||
|
"bz2",
|
||||||
|
"tbz",
|
||||||
|
"xz",
|
||||||
|
"br",
|
||||||
|
"swf",
|
||||||
|
"flv",
|
||||||
|
"woff",
|
||||||
|
"woff2",
|
||||||
|
# custom to improve speed
|
||||||
|
"pdf",
|
||||||
|
"svg",
|
||||||
|
)
|
||||||
|
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
|
||||||
|
|
||||||
if APP_ENVIRONMENT == "local":
|
if APP_ENVIRONMENT == "local":
|
||||||
# http://whitenoise.evans.io/en/latest/django.html#using-whitenoise-in-development
|
# http://whitenoise.evans.io/en/latest/django.html#using-whitenoise-in-development
|
||||||
INSTALLED_APPS = ["whitenoise.runserver_nostatic"] + INSTALLED_APPS # noqa F405
|
INSTALLED_APPS = ["whitenoise.runserver_nostatic"] + INSTALLED_APPS # noqa F405
|
||||||
|
|
@ -679,9 +702,6 @@ else:
|
||||||
"DJANGO_SECURE_CONTENT_TYPE_NOSNIFF", default=True
|
"DJANGO_SECURE_CONTENT_TYPE_NOSNIFF", default=True
|
||||||
)
|
)
|
||||||
|
|
||||||
# STATIC
|
|
||||||
# ------------------------
|
|
||||||
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
|
|
||||||
# MEDIA
|
# MEDIA
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,19 +16,6 @@
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@font-face {*/
|
|
||||||
/* font-family: 'Buenos Aires';*/
|
|
||||||
/* src: url('BuenosAires-Regular.eot');*/
|
|
||||||
/* src: local('Buenos Aires Regular'), local('BuenosAires-Regular'),*/
|
|
||||||
/* url('BuenosAires-Regular.eot?#iefix') format('embedded-opentype'),*/
|
|
||||||
/* url('BuenosAires-Regular.woff2') format('woff2'),*/
|
|
||||||
/* url('BuenosAires-Regular.woff') format('woff'),*/
|
|
||||||
/* url('BuenosAires-Regular.ttf') format('truetype');*/
|
|
||||||
/* font-weight: normal;*/
|
|
||||||
/* font-style: normal;*/
|
|
||||||
/* font-display: swap;*/
|
|
||||||
/*}*/
|
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Buenos Aires';
|
font-family: 'Buenos Aires';
|
||||||
src: local('Buenos Aires SemiBold'), local('BuenosAires-SemiBold'),
|
src: local('Buenos Aires SemiBold'), local('BuenosAires-SemiBold'),
|
||||||
|
|
@ -82,17 +69,3 @@
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@font-face {*/
|
|
||||||
/* font-family: 'Buenos Aires';*/
|
|
||||||
/* src: url('BuenosAires-RegularItalic.eot');*/
|
|
||||||
/* src: local('Buenos Aires Regular Italic'), local('BuenosAires-RegularItalic'),*/
|
|
||||||
/* url('BuenosAires-RegularItalic.eot?#iefix') format('embedded-opentype'),*/
|
|
||||||
/* url('BuenosAires-RegularItalic.woff2') format('woff2'),*/
|
|
||||||
/* url('BuenosAires-RegularItalic.woff') format('woff'),*/
|
|
||||||
/* url('BuenosAires-RegularItalic.ttf') format('truetype');*/
|
|
||||||
/* font-weight: normal;*/
|
|
||||||
/* font-style: italic;*/
|
|
||||||
/* font-display: swap;*/
|
|
||||||
/*}*/
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue