Serving static files in development doesn't work with staticfiles activated
|Reported by:||Florian Sening||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I have a few static files living in STATIC_ROOT that get served correctly when staticfiles is not in INSTALLED_APPS. So using things like http://localhost:8000/static/myfolder/ just work. However when I enable staticfiles things like http://localhost:8000/static/myfolder/ yield a 404 saying "'myfolder\' could not be found". Maybe i'm using staticfiles wrong (i have no idea where site-specific stuff (e.g. favicon, robots, site-global css, etc. should go) but shouldn't the contents in STATIC_ROOT just get served?
STATIC_ROOT = os.path.join(os.path.dirname(__file__), '../static/').replace('\\', '/') STATIC_URL = '/static/' ADMIN_MEDIA_PREFIX = '/static/admin/'
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT, show_indexes=True)
Change History (7)
comment:1 follow-up: 2 Changed 5 years ago by
|Patch needs improvement:||unset|
|Status:||new → closed|
comment:5 Changed 5 years ago by
|Status:||closed → reopened|
|Triage Stage:||Unreviewed → Accepted|
|Type:||Uncategorized → Bug|