Load custom template tag from another application?

佐手、 提交于 2019-12-23 15:07:51

问题


Is this possible in any way? My project folder structure looks like this:

my_project:
    app1:
        templatetags:
            my_tags1.py (contains simple tags and inclusion tags)
    app2:
        templatetags:
            my_tags2.py (contains some simple tags)
    templates:
        app1: index.html
        app2: index.html

The ideas is to use a tag from my_tags1.py on the template app2/index.html. I simply tried:

{% load my_tags1 %} 

but that gives me an error.


回答1:


Make sure the tag files have different names.



来源:https://stackoverflow.com/questions/2404830/load-custom-template-tag-from-another-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!