Opened 5 years ago

Closed 5 years ago

Last modified 5 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 Changed 5 years ago by Moritz Sichert

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

comment:2 Changed 5 years ago by Moritz Sichert

Cc: moritz.sichert@… added

comment:3 Changed 5 years ago by Aymeric Augustin

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

comment:4 Changed 5 years ago by Carl Meyer

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 Changed 5 years ago by Carl Meyer

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 Changed 5 years ago by Tim Graham

Component: contrib.staticfilesDocumentation

comment:7 Changed 5 years ago by Chris McCollister

Owner: changed from nobody to Chris McCollister
Status: newassigned

comment:8 Changed 5 years ago by Chris McCollister

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 Changed 5 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In d62194a:

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

comment:10 Changed 5 years ago by Tim Graham <timograham@…>

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