The merging is between the final user settings and global_settings. The 
advantage is not having to redeclare all the keys in a setting like:

SECURITY_MIDDLEWARE = {
    'HSTS_SECONDS': 0,
    'HSTS_INCLUDE_SUBDOMAINS': False,
    'CONTENT_TYPE_NOSNIFF': False,
    'BROWSER_XSS_FILTER': False,
    'SSL_REDIRECT': False,
    'SSL_HOST': None,
    'REDIRECT_EXEMPT': [],
}

if you only want to customize one of them.


If base.py adds CONTENT_TYPE_NOSNIFF and prod.py wants to add HSTS_SECONDS, 
it would look like this:

base.py
SECURITY_MIDDLEWARE = {'CONTENT_TYPE_NOSNIFF': True}

prod.py
from base import *
SECURITY_MIDDLEWARE['HSTS_SECONDS'] = 31536000

On Saturday, August 30, 2014 8:08:59 AM UTC-4, Florian Apolloner wrote:
>
>
>
> On Saturday, August 30, 2014 1:58:07 PM UTC+2, Aymeric Augustin wrote:
>>
>> On 30 août 2014, at 13:39, Florian Apolloner <[email protected]> wrote: 
>>
>> > And what would that give us? if I want override FOO['BAR'] where from 
>> would I override FOO with that merging behavior in place? 
>>
>> From your settings file. 
>>
>
> Okay, so let's assume I have base.py and prod.py as settings (the latter 
> star imports the first), prod.py wants to extend DATABASES from base.py or 
> global_settings if it's not in base.py -- I don't see how that would work. 
> Or is the merging just for the final prod.py and global_settings, in which 
> case I have to say that there isn't much of a win.
>
> Cheers,
> Florian
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" 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/c77da0af-65b0-4044-992a-5f7fd4fd206f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to