Answer the question
In order to leave comments, you need to log in
How to change templatetags directory?
I have file custom_template_tags.py with code like this
from django import template
from random import randint
register = template.Library()
@register.simple_tag
def random_number():
return randint(0,999)
is not a registered tag library. Must be one of:
INSTALLED_APPS = [
'templatetags.custom_template_tags',
]
Answer the question
In order to leave comments, you need to log in
The app should contain a templatetags directory, at the same level as models.py, views.py, etc.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question