djangouser9
djangouser9

Reputation: 31

Migrate from HTTP to HTTPS

How to set up a project to use HTTPS? What do I need?

I use Django 1.4.2

I added

#https
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True

How to configure urls.py? Does anyone have a sample configuration?

Upvotes: 2

Views: 150

Answers (2)

Matt
Matt

Reputation: 10312

Maybe this could help: https://github.com/teddziuba/django-sslserver

This will give you the ability to accept HTTPS requests using only Django.

Upvotes: 0

Hedde van der Heide
Hedde van der Heide

Reputation: 22449

After you have bought and installed a certificated there's three ways to redirect from http to https.

  1. Proxy configuration. (Allow HTTPS only)
  2. Create a http to https redirection in the server configuration file
  3. Use Django middleware for this, e.g.: http://djangosnippets.org/snippets/880/

Upvotes: 2

Related Questions