Running Django 1.2.1 with Python 2.6
I am trying to create a simple test tag (the more complex ones are not
working either...).
In the templatetags directory, I have this code in the my_tags.py file:
from django import template
register = template.Library()
@register.tag
def foo(eggs=None, spam=None):
return "foo"
foo.is_safe = True
And in the template file that uses it I have:
{% load my_tags %}
{% foo %}
However, when I try and load the template file, I get a:
Exception Type: AttributeError at /path/to/url
Exception Value: 'str' object has no attribute 'source'
error, and the full trace path includes no references to my source file(s).
What (presumably obvious) mistake am I making?
Thanks
Derek
--
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.