1 Commits

Author SHA1 Message Date
codex_a
bf1187bc65 fix: use plain StaticFilesStorage 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 1m22s
CompressedManifestStaticFilesStorage requires collectstatic to generate a
manifest before it can serve anything. Dev containers never run collectstatic
so every static asset 404s. Override to StaticFilesStorage in dev so Django
serves files directly from STATICFILES_DIRS and app static directories.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-28 20:48:56 +00:00

View File

@@ -4,11 +4,9 @@ DEBUG = True
INTERNAL_IPS = ["127.0.0.1"] INTERNAL_IPS = ["127.0.0.1"]
# In dev, drop WhiteNoise from middleware and use plain static file storage. # Use plain static file storage in dev — CompressedManifestStaticFilesStorage
# WhiteNoise serves from STATIC_ROOT which is empty without collectstatic, # (set in base.py) requires collectstatic to have been run and will 404 on
# so it intercepts every /static/ request and returns nothing. # every asset otherwise.
# 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: