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.1.1a2.zip (9.7 kB view details)

Uploaded Source

Built Distribution

django-ssl-slapper-0.1.1a2.win32.exe (203.1 kB view details)

Uploaded Source

File details

Details for the file django-ssl-slapper-0.1.1a2.zip.

File metadata

File hashes

Hashes for django-ssl-slapper-0.1.1a2.zip
Algorithm Hash digest
SHA256 13175bb4e8ba9ea37534c7113eb958c91660176d42ec8082d3f7e88f32fa7400
MD5 ff8f0c3f0bf18b1da8bd28d175fc496b
BLAKE2b-256 e3c7108be3af12de723742185902c9c4f644c1dada714fcea3faeb896549f786

See more details on using hashes here.

File details

Details for the file django-ssl-slapper-0.1.1a2.win32.exe.

File metadata

File hashes

Hashes for django-ssl-slapper-0.1.1a2.win32.exe
Algorithm Hash digest
SHA256 3a9e1d26ed00214ccdd125762333deb04aaacdcf58530f48fcacf70514671af3
MD5 960e170875b80e8afbc44a5a12727235
BLAKE2b-256 911371905929767263927cd77c3583d9062b1418abad696e0a29e24967b13179

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