On Mon, Nov 16, 2009 at 10:04 PM, Alex Gaynor <alex.gay...@gmail.com> wrote:
> On Mon, Nov 16, 2009 at 8:58 AM, Russell Keith-Magee
> <freakboy3...@gmail.com> wrote:
>> On Thu, Nov 12, 2009 at 9:15 AM, Mike Malone <mjmal...@gmail.com> wrote:
>>> Sup,
>>>
>>> I've been working on template caching (ticket #6262) with a mister
>>> Alex Gaynor. The patch is getting pretty stable and I think it's close
>>> to merge-able, so if anyone wants to take a look at what we've got and
>>> provide feedback: go!
...
>>  * On the subject of specifying loaders - in order to use the cached
>> loader, we need to import the cached loader, and have support for
>> callable loaders in find_template_loader. Requiring imports in the
>> settings file seems like a bit of a wart to me.
>>
>> Here's an alternate proposal - rather than allowing callables, how
>> about allowing entries in TEMPLATE_LADERS to be tuples, and
>> interpreting the [1:] elements of the tuple as the arguments to the
>> loader - for example:
>>
>> TEMPLATE_LOADERS = (
>>    ('django.template.loaders.cached', (
>>            'django.template.loaders.filesystem.loader',
>>            'django.template.loaders.app_directories.loader',
>>        )
>>    )
>> )
>>
> I think this could get fairly complicated quickly, for example is this valid?
>
> TEMPLATE_LOADERS = (
>    ('django.templaet.loaders.cached', (
>        ('django.template.loaders.filesystem', (
>            '/home/alex/django/templates/',
>        )
>    )
> )

Sure. Why not? The intention of what you have written seems pretty
clear to me (typo and missing brackets notwithstanding :-).

> Frankly it seems more trouble then it's worth, adding a
> CACHED_TEMPLATE_LOADER setting, though vaguely un-dry seems a good
> deal cleaner.

That would be the other way to skin that particular cat, and it would
be the way that is consistent with the existing TEMPLATE_DIRS setting
for the filesystem loader.

My only hesitation here is that I'm not wild about the proliferation
of new settings that results. For me, the appeal of keeping this all
in a single setting is that we get to consolidate the configurations
of every template loader in a predictable way.

Russ %-)

--

You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=.


Reply via email to