Skip to main content

SSL/HTTPS for Django

Project description

bpssl is a Django application that helps you support HTTPS on your website. The main functionality is performing redirection for HTTPS only URLs and views. For instance, if a request for your login view ‘/login’ is recieved over HTTP, the provided middleware can redirect the user to the equivalent HTTPS page.

Specifying views and urls as secure is supported as are flatpages. Fastcgi and HTTP proxy setups are also well supported. See the documentation at:

bpssl draws inspiration from the well known SSL Middleware snippets on djangosnippets.org. It roughly supports the features of the following snippets:

Please file bugs at: http://bitbucket.org/beproud/bpssl/issues/

Middleware

bpssl provides an SSLRedirectMiddleware which can redirect users from secure pages to non-secure pages and visa-versa. Urls are set up by adding regular expressions to the SSL_URLS setting in settings.py. SSLRedirectMiddleware can also be extended to support more specific use cases.

ssl_view decorator

bpssl provides an ssl_view() decorator which can be used instead of the SSL_URLS to specify that a particular view should be secure.

Development

Generally you will want to develop bpssl in a virtualenv with pip:

$ mkvirtualenv bpssl

You can install the requirements using the requirements.txt and pip:

$ pip install -r setup/requirements.txt

And run tests normally using setup.py:

$ python setup.py test

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bpssl-1.0.1.tar.gz (267.8 kB view details)

Uploaded Source

File details

Details for the file bpssl-1.0.1.tar.gz.

File metadata

  • Download URL: bpssl-1.0.1.tar.gz
  • Upload date:
  • Size: 267.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for bpssl-1.0.1.tar.gz
Algorithm Hash digest
SHA256 45485c5c00c9c794260b75686de84db3454da916e3873aa26987f7f591bc553c
MD5 a1849f95d8d110560868428127483a23
BLAKE2b-256 dc4d089905bbf9a4baafbdfe247ef194c21522587644bc480837535652d7f634

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page