fix: remove WhiteNoise middleware in dev settings
All checks were successful
CI / nightly-e2e (pull_request) Has been skipped
CI / pr-e2e (pull_request) Successful in 1m4s
CI / ci (pull_request) Successful in 1m23s

WhiteNoise intercepts all /static/ requests and serves from STATIC_ROOT.
Without collectstatic that directory is empty, so every asset 404s regardless
of the storage backend. Remove it from MIDDLEWARE in development so Django's
runserver handles static files natively (DEBUG=True is enough).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
codex_a
2026-02-28 20:52:36 +00:00
parent 36eb0f1dd2
commit 800475cf36

View File

@@ -4,9 +4,11 @@ DEBUG = True
INTERNAL_IPS = ["127.0.0.1"] INTERNAL_IPS = ["127.0.0.1"]
# Use plain static file storage in dev — CompressedManifestStaticFilesStorage # In dev, drop WhiteNoise from middleware and use plain static file storage.
# (set in base.py) requires collectstatic to have been run and will 404 on # WhiteNoise serves from STATIC_ROOT which is empty without collectstatic,
# every asset otherwise. # so it intercepts every /static/ request and returns nothing.
# Django's runserver handles static files natively when DEBUG=True.
MIDDLEWARE = [m for m in MIDDLEWARE if m != "whitenoise.middleware.WhiteNoiseMiddleware"]
STATICFILES_STORAGE = "django.contrib.staticfiles.storage.StaticFilesStorage" STATICFILES_STORAGE = "django.contrib.staticfiles.storage.StaticFilesStorage"
try: try: