Skip to content

Commit

Permalink
[#16] add whitenoise setting to static serve
Browse files Browse the repository at this point in the history
  • Loading branch information
Dayof committed Nov 1, 2018
1 parent abaca28 commit bd81ac3
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions website/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
]

MIDDLEWARE = [
# Simplified static file serving.
# https://warehouse.python.org/project/whitenoise/
'whitenoise.middleware.WhiteNoiseMiddleware',
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
Expand Down Expand Up @@ -116,6 +119,16 @@


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.1/howto/static-files/

# https://docs.djangoproject.com/en/1.9/howto/static-files/
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATIC_URL = '/static/'

# Extra places for collectstatic to find static files.
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)

# Simplified static file serving.
# https://warehouse.python.org/project/whitenoise/

STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'

0 comments on commit bd81ac3

Please sign in to comment.