Skip to main content

A middleware that secures URLS.

Project description

Django django-ssl-slapper is a middleware that allows you to set urls to ssl only. It can also redirects anonymous users off your https service onto your http. Logged-in users may also be directed to https.

Decorators are also included that use cache to count the number of login attempts. Excessive login attempts, for example from computer hackers, temporary lock the login page.

Installation

`pip install django-ssl-slapper`

Add `ssl_slapper.middleware.ssl_slapper` to middleware in your django settings file

Securing Views

To secure a url simply add it to the list in your settings file. For example:

Add the decorator to login pages, for example:
url(r’^account/login/$’,
decorators.redirect_authenticated_user()(decorators.ratelimit_login()(auth_views.login)), {‘template_name’: ‘registration/login.html’},name=’auth_login’),

Settings

`SSL_SLAPPER_SSL_ONLY_PAGES = ('/account/login/','/admin/.*')` Add to this list any pages that you want as ssl.

`SSL_SLAPPER_SSL_REDIRECT_ANONYMOUS=True` Set to true to redirect anonymous users to http.

`SSL_SLAPPER_SSL_REDIRECT_AUTHENTICATED=True` Set to true to redirect authenticated users to https.

Project details


Download files

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

Files for django-ssl-slapper, version 0.1.1a2
Filename, size File type Python version Upload date Hashes
Filename, size django-ssl-slapper-0.1.1a2.win32.exe (203.1 kB) File type Windows Installer Python version any Upload date Hashes View
Filename, size django-ssl-slapper-0.1.1a2.zip (9.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page