On Dec 10, 2:41 pm, Gary Wilson <[EMAIL PROTECTED]> wrote:
> The current app_directories template loader has always bugged me because it 
> is:
>
> 1) inefficient - all application template directories are added as global
> template directories and are searched each time by the template loader.
>
> 2) unpredictable - any application could, unbeknownst to the developer,
> override another application's templates.  For example, an application could
> include an "admin" directory in its "templates" directory that overrides admin
> templates.
>
> 3) not DRY - just silly I have to make my "templates" directory one level
> deeper with a duplicated name.
>
> For those of you that have stopped using the app_directories loader in favor
> of the standard filesystem loader and TEMPLATE_DIRS, what was your reasoning
> behind doing so?
>
> And doesn't doing things this was cause the same problems?  Every directory
> added is going to get searched as a global template directory.  You're still
> going to have the unpredictability of apps possibly overriding templates of
> other apps.  You are still going to be repeating yourself by having to put the
> app in INSTALLED_APPS and its template directory in TEMPLATE_DIRS.
>
> I have always thought that you should be able to put an app's templates in its
> "templates" directory and that those templates should only be accessible when
> using the app name in front of it, like "myblogapp/base.html".  The
> "myblogapp/templates" directory should not be looked at in any other case, and
> only global template directories are looked at every time by the filesystem
> template loader.

You're not forced to use the app_directories loader. I'm sure some
people are using it in their project specifically for overriding admin
templates.

What you're proposing is a separate loader. It sounds easily doable
(and like a reasonable idea).
I'd suggest it just uses a "local_templates" directory or similar
rather than stepping on the toes of app_directories loader.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to