Skip to content

Commit

Permalink
install whitenoise to deal with static files on render
Browse files Browse the repository at this point in the history
  • Loading branch information
Moggach committed Feb 12, 2024
1 parent f878c45 commit a81d245
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions app/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,9 @@
"django.middleware.security.SecurityMiddleware",
]

if USE_WHITENOISE:
MIDDLEWARE += [
"whitenoise.middleware.WhiteNoiseMiddleware",
]

MIDDLEWARE += [
'django.middleware.security.SecurityMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
Expand Down
4 changes: 2 additions & 2 deletions app/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from .base import *

if USE_WHITENOISE:
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"


DEBUG = False
SECRET_KEY = os.getenv("SECRET_KEY")
Expand Down

0 comments on commit a81d245

Please sign in to comment.