#15344 closed (worksforme)
STATIC_ROOT is not considered when serving static files with staticfiles_urlpatterns
| Reported by: | Carlo Pires | Owned by: | nobody |
|---|---|---|---|
| Component: | Uncategorized | Version: | dev |
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
As django.contrib.staticfiles.finders.FileSystemFinder blocks settings.STATIC_ROOT to be on
settings.STATICFILES_DIR, django.contrib.staticfiles.finders.find() should consider settings.STATIC_ROOT on lookup for static files.
Change History (3)
comment:1 by , 15 years ago
| Resolution: | → worksforme |
|---|---|
| Status: | new → closed |
follow-up: 3 comment:2 by , 15 years ago
This SHOULD be on documentation to avoid confusion:
"STATIC_ROOT is not the file system location you put your static files into but where the staticfiles' app collectstatic management command copies files to."
comment:3 by , 15 years ago
Replying to carlopires:
This SHOULD be on documentation to avoid confusion:
"STATIC_ROOT is not the file system location you put your static files into but where the staticfiles' app collectstatic management command copies files to."
This is covered here: http://docs.djangoproject.com/en/dev/ref/settings/#std:setting-STATIC_ROOT
I don't understand what setting STATIC_ROOT dynamically would bring.
To reiterate,
STATIC_ROOTis not the file system location you put your static files into but where the staticfiles' app collectstatic management command copies files to. In other words, if you have separate directories you want the staticfiles app to consider to copy, just add those separate directories to theSTATICFILES_DIRSsetting. For example if you have a "project" static directory, e.g.:STATIC_ROOT = "/var/www/static" STATIC_URL = "/static/" STATICFILES_DIRS = ( "/path/to/my/site/project/static", )