Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Fixing app_label

MIME-Version: 1.0
Message-ID: <9c2afcfd-73ad-463d-be6b-e7d6b90319a5@b40g2000prf.googlegroups.com>
Date: Sun, 9 Dec 2007 18:42:32 -0800 (PST)
Received: by 10.100.123.4 with SMTP id v4mr212200anc.1197254552548; Sun, 09 
	Dec 2007 18:42:32 -0800 (PST)
In-Reply-To: <475C9938.6060903@gmail.com>
X-IP: 203.97.111.154
References: <be4ebbe10712050955x20e7b084y1e74c7c2c1f25a94@mail.gmail.com> 
	<1197015903.8093.32.camel@counterweight.tredinnick.org> <9c84dcc1-4e19-4733-aba2-f5b1f2eed725@e6g2000prf.googlegroups.com> 
	<7e8d40920712071035j5ec3c402w733a0dc4881ab27a@mail.gmail.com> 
	<ac56702a-d46c-49f5-afaf-47ec859f0bcf@f3g2000hsg.googlegroups.com> 
	<475C9938.6060903@gmail.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.11) 
	Gecko/20071204 Ubuntu/7.10 (gutsy) Firefox/2.0.0.11,gzip(gfe),gzip(gfe)
Subject: Re: Fixing app_label
From: SmileyChris <smileych...@gmail.com>
To: Django developers <django-developers@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit



On Dec 10, 2:41 pm, Gary Wilson <gary.wil...@gmail.com> 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