Django Relative Urls And Https
Solution 1:
As Tomasz suggests, one way to do it is to set up middleware to redirect to and from https as necessary. Here's one implementation - the idea is to decorate those views that should be served under https, and when the user navigates to a view that shouldn't be secure from one that is, the middleware redirects them automatically back to the http version of the page.
Solution 2:
Idea: you can use a custom middleware to redirect from https to http (or vice versa) for centrain URLs or URL patterns. This could also be done in Apache (or other web server) configuration.
Solution 3:
Solution 4:
I find this snippet takes care of the situation nicely. Views that need SSL will have them, via a redirect from the http to https version of the url, and vice-versa.
Yes, on a https page, the outbound link to a non-https page in your site will still start with https, but the user will be redirected to the http version.
(There is a gotcha, however: it won't work if you're posting from http to https and vice versa)
Solution 5:
maybe this can serve for you
http://code.djangoproject.com/wiki/ContributedMiddleware#SSLMiddlewarebyStephenZabel
an contributed SSL Middleware
Post a Comment for "Django Relative Urls And Https"