Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#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 Moritz Sichert, 9 years ago

I already implemented it here:
https://github.com/MoritzS/jinja2-django-tags

comment:2 by Moritz Sichert, 9 years ago

Cc: moritz.sichert@… added

comment:3 by Aymeric Augustin, 9 years ago

There is some documentation here. Look for "For example, you can create myproject/jinja2.py ...".

comment:4 by Carl Meyer, 9 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 Carl Meyer, 9 years ago

Easy pickings: set
Summary: Staticfiles should provide a Jinja2 extension with a Jinja2 equivalent for the `{% static %}` tagStaticfiles docs should clarify Jinja2 equivalent for `{% static %}` tag
Triage Stage: UnreviewedAccepted

comment:6 by Tim Graham, 9 years ago

Component: contrib.staticfilesDocumentation

comment:7 by Chris McCollister, 9 years ago

Owner: changed from nobody to Chris McCollister
Status: newassigned

comment:8 by Chris McCollister, 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.

comment:9 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: assignedclosed

In d62194a:

Fixed #24984 -- Added link to Jinja2 static tag instructions in staticfiles docs.

comment:10 by Tim Graham <timograham@…>, 9 years ago

In f8140c4:

[1.8.x] Fixed #24984 -- Added link to Jinja2 static tag instructions in staticfiles docs.

Backport of d62194a260eedd30aeea78f407032aabfde4be70 from master

Note: See TracTickets for help on using tickets.
Back to Top