Forums

How to force https in Mezzanine

I would like to ask for help in forcing https in Mezzanine. If I use https, it works, however http also works and it doesn't redirect to https.

From the documentation I figured out that the following settings should be used in settings.py:

SSL_ENABLED = True
SSL_FORCED_PREFIXES_ONLY = False
SSL_FORCE_HOST = 'www.mysite.com'

and from a forum that

"mezzanine.core.middleware.SSLRedirectMiddleware",

should be in the MIDDLEWARE_CLASSES.

However this doesn't work, http is not redirected to https.

Thank you for your help.

Have you reloaded the website (on the "Web" page inside PythonAnywhere) after changing settings.py?

If you have, can we take a look at your files? We can see them from our admin interface, but we always ask for permission first. I see that you have two websites associated with your account, so please let us know which one it is (use the "Send feedback" link above if you want to tell us privately -- you'll also need to give us the username/password to access the site, as it looks like they're both password-protected.)

Thank you, I have written to you by the Send feedback link.