问题
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