load django templatetags from custom location -
I'm trying to load custom templatetags the nonstandard location , ie. project.myapp.templatetags >
project.myapp.extra_level.templatetags
.
I can load them globally on the django.template.base.add_to_builtins
but that's just bad behavior of IMHO.
django.template.base import add_to_builtins from add_to_builtins .custom_tags using ( 'myapp.extra_level.templatetags')
Unfortunately, as "TEMPLATE_DIRS" a setting does not exist, so I like that a choice had to be creative saving a life :)
first consider and
and loaded in your settings, but of course I have "RuntimeError: Application registry installed so far No " load_all_installed_template_libraries
to a similar use Django.contrib.admindocs.views
Another idea project.myapp .__ init __ (for all those templatetag libraries are where
project.myapp.extra_level.templatetags
), but based on loading files templatetag libraries.
Any way to achieve this goal? Maybe I can in some way show deeper files and fake them through the __init __
file? Or is there a better way to load templatetags from custom place?
Comments
Post a Comment