Kaydet (Commit) 084573c7 authored tarafından Andy Chosak's avatar Andy Chosak Kaydeden (comit) Tim Graham

Updated Jinja2 static tag example to use django.templatetags.

As of cf546e11, this is the
canonical way to invoke the static tag.
üst dc5e75d4
......@@ -451,7 +451,7 @@ environment.
For example, you can create ``myproject/jinja2.py`` with this content::
from django.contrib.staticfiles.storage import staticfiles_storage
from django.templatetags.static import static
from django.urls import reverse
from jinja2 import Environment
......@@ -460,7 +460,7 @@ For example, you can create ``myproject/jinja2.py`` with this content::
def environment(**options):
env = Environment(**options)
env.globals.update({
'static': staticfiles_storage.url,
'static': static,
'url': reverse,
})
return env
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment