Enable whitenoise for dev environment, closer to production
This commit is contained in:
parent
bc324c5769
commit
8a6638e28d
|
@ -28,6 +28,7 @@ DJANGO_APPS = (
|
||||||
'django.contrib.sessions',
|
'django.contrib.sessions',
|
||||||
'django.contrib.sites',
|
'django.contrib.sites',
|
||||||
'django.contrib.messages',
|
'django.contrib.messages',
|
||||||
|
'whitenoise.runserver_nostatic',
|
||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
'django.contrib.humanize',
|
'django.contrib.humanize',
|
||||||
'django.contrib.admin',
|
'django.contrib.admin',
|
||||||
|
@ -65,6 +66,7 @@ INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
MIDDLEWARE = (
|
MIDDLEWARE = (
|
||||||
'django.middleware.security.SecurityMiddleware',
|
'django.middleware.security.SecurityMiddleware',
|
||||||
|
'whitenoise.middleware.WhiteNoiseMiddleware',
|
||||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||||
'django.middleware.common.CommonMiddleware',
|
'django.middleware.common.CommonMiddleware',
|
||||||
'django.middleware.csrf.CsrfViewMiddleware',
|
'django.middleware.csrf.CsrfViewMiddleware',
|
||||||
|
|
|
@ -90,3 +90,5 @@ CAPTCHA = {
|
||||||
'site': ''
|
'site': ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WHITENOISE_AUTOREFRESH = True
|
||||||
|
WHITENOISE_USE_FINDERS = True
|
||||||
|
|
|
@ -24,9 +24,6 @@ SECRET_KEY = env('DJANGO_SECRET_KEY')
|
||||||
# SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
# SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
||||||
# Use Whitenoise to serve static files
|
# Use Whitenoise to serve static files
|
||||||
# See: https://whitenoise.readthedocs.io/
|
# See: https://whitenoise.readthedocs.io/
|
||||||
WHITENOISE_MIDDLEWARE = ('whitenoise.middleware.WhiteNoiseMiddleware', )
|
|
||||||
MIDDLEWARE = WHITENOISE_MIDDLEWARE + MIDDLEWARE
|
|
||||||
|
|
||||||
|
|
||||||
# SECURITY CONFIGURATION
|
# SECURITY CONFIGURATION
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
@ -93,8 +90,8 @@ AWS_HEADERS = {
|
||||||
|
|
||||||
# Static Assets
|
# Static Assets
|
||||||
# ------------------------
|
# ------------------------
|
||||||
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
|
# STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
|
||||||
|
STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
|
||||||
# COMPRESSOR
|
# COMPRESSOR
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
COMPRESS_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
|
COMPRESS_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
|
||||||
|
|
|
@ -24,9 +24,6 @@ SECRET_KEY = env('DJANGO_SECRET_KEY')
|
||||||
# SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
# SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
||||||
# Use Whitenoise to serve static files
|
# Use Whitenoise to serve static files
|
||||||
# See: https://whitenoise.readthedocs.io/
|
# See: https://whitenoise.readthedocs.io/
|
||||||
WHITENOISE_MIDDLEWARE = ('whitenoise.middleware.WhiteNoiseMiddleware', )
|
|
||||||
MIDDLEWARE = WHITENOISE_MIDDLEWARE + MIDDLEWARE
|
|
||||||
|
|
||||||
|
|
||||||
# SECURITY CONFIGURATION
|
# SECURITY CONFIGURATION
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
@ -93,7 +90,8 @@ AWS_HEADERS = {
|
||||||
|
|
||||||
# Static Assets
|
# Static Assets
|
||||||
# ------------------------
|
# ------------------------
|
||||||
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
|
# STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
|
||||||
|
STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
|
||||||
|
|
||||||
# COMPRESSOR
|
# COMPRESSOR
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue