How do you disable SECURE_SSL_REDIRECT for some views in Django?

37 views
Skip to first unread message

Mauro Sánchez

unread,
Sep 9, 2016, 8:45:04 PM9/9/16
to Django users
Hello, I configured in my settings SECURE_SSL_REDIRECT=True, but now I want to disable it for some views.
I have seen that there is an option SECURE_REDIRECT_EXEMPT where I can define a list of regular expressions for it.
But for some reason I can't make it work. I've tried to use the same regular expressions that I use in my urls.py, for example:
r'^index/$'

But it doesn't do anything. It is still redirecting it to HTTPS. Does anyone has an example of how to use it?
I am using Django 1.9

Thanks a lot.
Cheers.
Mauro.
Reply all
Reply to author
Forward
0 new messages