views:

129

answers:

2

I'm trying to write a custom inclusion_tag in django.

Following the example on http://docs.djangoproject.com/en/dev/howto/custom-template-tags/

I'm just writing

@register.inclusion_tag('test.html')

where test.html is a file in the same directory ( apps/my_app/templatetags) as the .py file which defines it.

But I'm getting a

TemplateDoesNotExist: test.html

error. Which I suppose is because django can't find the template.

How could I check this? And what determines where django looks for the file?

+1  A: 

I believe the included file is found by searching in the template locations defined in your settings file.

scompt.com
+1  A: 

Templates for templatetags go in the same places as those for normal views.

Daniel Roseman
ok, I found, thanks
interstar