#24984 closed New feature (fixed)
Staticfiles docs should clarify Jinja2 equivalent for `{% static %}` tag
Reported by: | Carl Meyer | Owned by: | Chris McCollister |
---|---|---|---|
Component: | Documentation | Version: | 1.8 |
Severity: | Normal | Keywords: | |
Cc: | moritz.sichert@… | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
It's trivial to implement, but the lack of it (and the lack of documentation for using staticfiles with Jinja2) is a major hurdle for a new user. (Not hypothetical, just encountered such a user in IRC.)
Change History (10)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
Cc: | added |
---|
comment:3 by , 10 years ago
There is some documentation here. Look for "For example, you can create myproject/jinja2.py ...".
comment:4 by , 10 years ago
Ah, missed those docs; thanks Aymeric.
That code is so simple, it may be that providing a Jinja2 extension is unnecessary. I think it would be good to at least duplicate or reference those docs somewhere in this area: https://docs.djangoproject.com/en/1.8/ref/contrib/staticfiles/#template-tags (that is, in the staticfiles docs, not just in the Jinja2 backend docs).
comment:5 by , 10 years ago
Easy pickings: | set |
---|---|
Summary: | Staticfiles should provide a Jinja2 extension with a Jinja2 equivalent for the `{% static %}` tag → Staticfiles docs should clarify Jinja2 equivalent for `{% static %}` tag |
Triage Stage: | Unreviewed → Accepted |
comment:6 by , 10 years ago
Component: | contrib.staticfiles → Documentation |
---|
comment:7 by , 9 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:8 by , 9 years ago
Work on this ticket is available here: https://github.com/vallarfax/django/tree/ticket_24984
Added a note to the staticfiles documentation that references the instructions for configuring and using the static template tag with Jinja2.
I already implemented it here:
https://github.com/MoritzS/jinja2-django-tags