Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!

Close

bpssl

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

Recent activity

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.