Hello, I'm reading 'Practical Django Projects' and I'm getting this
error from section 'A Simple Custom Tag' on chapter 6:
TemplateSyntaxError at /weblog/
'coltrane_tags' is not a valid tag library: Could not load template
library from django.templatetags.coltrane_tags, No module named
coltrane_tags
I have the correct directory structure:
coltrane
- templatetags
- __init__.py
- coltrane_tags.py
The coltrane apps is installed and I have it in my path, I'm correctly
importing from it in many other places.
The error is coming when loading the tags in my base.html:
{% load coltrane_tags %}
To fix this I added 'coltrane.templatetags' to my INSTALLED_APPS.
I'm not sure if this is a bug in Django as the book says:
"The {% load coltrane_tags %} tag tells Django you want to load a
custom template tag
library named coltrane_tags. When Django sees this, it will look
through all of your
installed applications for a templatetags directory containing a file
named coltrane_
tags.py, and it will load any tags defined there."
So, it should be enough just having 'coltrane' in INSTALLED_APPS, am I
correct?
I'd like to know more about this.
Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---