Hi Russ,
On 01/11/2015 05:20 PM, Russell Keith-Magee wrote:
>> Without having spent much time to research the consequences — it's on my
>> TODO list but Collin brought it up before I investigated — my straw man
>> proposal is:
>>
>> TEMPLATES = [
>> {
>> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
>> 'DIRS': [],
>> 'APP_DIRS': True,
>> 'OPTIONS': {
>> 'context_processors': [
>> 'django.template.context_processors.debug',
>> 'django.template.context_processors.request',
>> 'django.contrib.auth.context_processors.auth',
>> 'django.contrib.messages.context_processors.messages',
>> ],
>> },
>> },
>> ]
>>
>
> Given that tz and i18n aren't doing anything significant, and media/static
> aren'tt doing it right, this list makes sense to me as defaults.
>
> In my ideal world, we wouldn't need to specify these at all in the settings
> file - I'd almost propose that the Django template engine should have those
> context processors baked in by default, unless manually specified by the
> end user (i.e., if 'context_processors' in OPTIONS:). The goal of the
> simplification of the project template was to get all the extra cruft out
> of a default working template; having a bunch of boilerplate that many/most
> new users won't need to modify seems like a step backward in that regard.On the other hand, there are some significant disadvantages to having non-empty default values for list settings: 1) Less explicit - things show up in the template context and new users have no idea where they might have come from. 2) As soon as you want to add a context processor, you have to find the docs or `global_settings.py` and copy-paste the default value in, and if you don't know that that's necessary it may not be obvious what you broke or how to fix it. I sympathize with the goal of a less-crufty default project template, but in this case I find the argument for "explicit is better than implicit" more compelling. It just makes sense that the default settings for a template engine wouldn't magically add anything to the template context. Carl -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/54B33158.7030704%40oddbird.net. For more options, visit https://groups.google.com/d/optout.
signature.asc
Description: OpenPGP digital signature
