views:

58

answers:

1

In our project, we have a bunch of different templates that clients to choose from (for their webstore). The file layout is something like this:

templates
    cart.html
    closed.html
    head.html
    standard
        bishop
        default
        indiana
        marley
        mocca
        nihilists
        raconteurs
        tripwire

Every subfolder of standard contains a few template files like base.html, browse.html and item.html. Browse and Item inherit from base.

What I want to do is render the browse template in a specific template folder (let's say templates/standard/bishop) isolated from any other global template path settings in my app. Is there a way to do that?

UPDATE: I'll try to be more clear. If I just render browse.html from the bishop subfolder it tries to extend base.html and it can't find it. I could alter the settings template path to include the bishop folder, but I'm looking for a way to make it work leaving that alone.

+1  A: 

In your templates/standard/bishop/browse.html template you're doing the following:

{% extends "base.html" %}

This refers to templates/base.html and not templates/standard/bishop/base.html. By default Django will check your installed applications as well as the template directories that you specified under TEMPLATE_DIRS in settings.py.

This behavior is specified by TEMPLATE_LOADERS in settings.py:

You might be able to get away with what you're trying to do by creating your own template loader, otherwise simply specify the actual path to base.html:

{% extends "standard/bishop/base.html" %}
peterp