On Thu, Sep 4, 2014 at 7:36 PM, Collin Anderson <cmawebs...@gmail.com>
wrote:

> I'm trying to think outside the box on settings.
>
> If we want to logically group settings together, what if we supported
> syntax like this?
>
> MIDDLEWARE_CLASSES = (
>     'django.middleware.clickjacking.XFrameOptionsMiddleware',
>     SecurityMiddleware(content_type_nosniff=True, xss_filter=True),
> )
>
> It could be a more pythonic way for middleware to have their own settings.
>


This is likely to run afoul of circular imports. It would need to do
something like the following to provide init kwargs.

MIDDLEWARE_CLASSES = (
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    ('django.middleware.security.SecurityMiddleware',
{'content_type_nosniff': True, 'xss_filter': True}),
)

Regards,
Michael Manfre

-- 
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 django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
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/CAGdCwBuXspVUEb8QPkAJdiBL6cp-hf7F7Yh2v9jQevimZQo2Xw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to