Loading django custom template tag at onece
I have my custom template tag. How to load it at once, without {% load tag %}
in every template-file?
UPD:
As suggested by Yuji:
from django.template.loader开发者_开发问答 import add_to_builtins
add_to_builtins('myapp.templatetags.mytagslib')
however, I don't use django, only templates - what should i write instead of myapp.templatetags.mytagslib
?
UPD2: ok, tried django.templatetags...
, works ;-)
Here you go:
Load a Django template tag library for all views by default
Favorite Django Tips & Features?
I will remember this one, thanks :)
精彩评论