Hi Frank,

On 14 Feb 2007, at 11:45, Frank Tegtmeyer wrote:

>
> Hi,
>
> I ave a question about the philosophy behind the template loading
> mechanism (my background is Zope2 with the "local overrides global"
> approach).
> If I understand it right, all the (standard) template loaders form a
> namespace for templates that is used for all applications within a
> site:
..
> The given structure would have two sources for the same template
> "index.html". Which one is used, depends on the order of the installed
> applications setting if I understand the mechanism correctly.

Yes, but it's not good practice. Following URL:
   http://www.djangoproject.com/documentation/templates_python/

The section 'Using Subdirectories' explains.
Make it like this:

app1
   templates
      app1
         index.html
app2
   templates
      app2
        index.html
templates
   app1
      index.html
   app2
      index.html

If you have in your settings.py (default I think):
TEMPLATE_LOADERS = (
     'django.template.loaders.filesystem.load_template_source',
     'django.template.loaders.app_directories.load_template_source',
)

And then use:
   get_template('app1/index.html')

It should work fine:
- Non name clash
- And you can customize



-- 
Geert Vanderkelen
http://some-abstract-type.com




--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to