#14693 closed (fixed)
staticfiles app doesn't work with form media framework and 3rd party asset managers
Reported by: | Jannis Leidel | Owned by: | nobody |
---|---|---|---|
Component: | Contrib apps | Version: | 1.3-alpha |
Severity: | Keywords: | ||
Cc: | oleg.lomaka@… | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
As discussed with Russell and Carl on IRC (after quite some feedback on the mailing list), the current proposal to fix this is:
- Introduce new core settings:
STATIC_URL
,STATIC_ROOT
(which refer to non-user files, canonical setting for root of all static content) - form media and admin are modified to use this instead (starting to deprecate
ADMIN_MEDIA_PREFIX
?) - staticfiles app uses it too, as a replacement for its current
STATICFILES_URL
,STATICFILES_ROOT
(this is actually compaptible with the original 3rd party staticfiles app) - for existing projects we keep defaulting form media to
MEDIA_URL
and have checks ready for the migrated projects - new projects automatically enable staticfiles app and aren't problematic
Attachments (4)
Change History (8)
by , 14 years ago
Attachment: | 14693.1.diff added |
---|
comment:1 by , 14 years ago
Triage Stage: | Unreviewed → Accepted |
---|
Patch looks good. A couple notes:
- It looks like the get_staticfiles_prefix tag was removed completely (which is fine with me, tbh), but the docs reference a "get_static_prefix" tag, which I don't see.
- If STATIC_* are core settings now, should the static context processor move to core rather than staticfiles? I think it should.
comment:2 by , 14 years ago
Cc: | added |
---|
by , 14 years ago
Attachment: | 14693.2.diff added |
---|
Moved context processors and template tags to core since those settings are core settings.
by , 14 years ago
Attachment: | 14693.2.2.diff added |
---|
Moved context processors and template tags to core since those settings are core settings.
comment:3 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [14592]) Fixed #14693, #14709 -- Backwards incompatible change to rectify the confusion around the STATICFILES_URL and STATICFILES_ROOT settings.
- Two new global settings that will be used by -- but are not limited to -- the staticfiles app: STATIC_ROOT and STATIC_URL.
- Moving the 'django.contrib.staticfiles.templatetags.staticfiles' template tag to the core ('django.templatetags.static') and renaming it to 'get_static_prefix'.
- Moving the context processor 'django.contrib.staticfiles.context_processors.staticfiles' to the core ('django.core.context_processors.static') and renaming it to 'static'.
- Paths in media definitions will use STATIC_URL as the prefix if the value is not None, and falls back to the previously used MEDIA_URL.
Thanks again to the community for constructive criticism and Carl and Russ for sanity-inducing discussions on IRC.
Initial patch