开发者

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 :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜