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.

Source Distribution

django-ssl-slapper-0.1a1.zip (8.3 kB view details)

Uploaded Source

File details

Details for the file django-ssl-slapper-0.1a1.zip.

File metadata

File hashes

Hashes for django-ssl-slapper-0.1a1.zip
Algorithm Hash digest
SHA256 e9084b368042c49c733a1eca80e8e1d586a511623db7aeefbcb2fb37d59dea6c
MD5 2490a0824b8e4ced310841d9383e70fb
BLAKE2b-256 d48e020814db3078361cb09232b8253f6ba3eb7758c4e3d0cbdc45b4e0f1df36

See more details on using hashes here.

Supported by

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