views:

161

answers:

1

When using the register.inclusion_tag() shortcut on a Custom Template Tag, assuming you define the template as 'some_fragment.html', in what directories/order does Django try to find that template?

Assume as many 'defaults' as is reasonable.

The Custom Template Tag portion of the documentation doesn't list anything specific, except that the template there is one that is defined by the template tag author, not the designer.

I read that and assume that it might look in your custom template tags directory first, but haven't tried it yet, but I have a feeling that it does the 'usual defaults' for templates, and nothing magical or special... but it is pony powered, so I had to ask.

+2  A: 

It follows exactly the same rules as for any other template. That is, it will use the directories specified in your TEMPLATE_DIRS setting in order - then, depending on the contents of your TEMPLATE_LOADERS setting, will also look in templates subdirectories under each of your apps. It won't ever look in the templatetags directory itself.

Daniel Roseman