Skip to main content
Django SSL Redirect
===================

Django SSL Redirect is a middleware that ensures secured URLs and only secured URLs are accessed securely over HTTPS.

Installation
------------

Run `pip install django-ssl-redirect`

Add `ssl_redirect.middleware.SSLRedirectMiddleware` to the top of your MIDDLEWARE_CLASSES setting:

```python
MIDDLEWARE_CLASSES = (
'ssl_redirect.middleware.SSLRedirectMiddleware',
...
)
```

Securing Views
--------------
To secure a view simply add `'SSL': True` the views kwargs

```python
urlpatterns = patterns('my_app.views',
url(r'^secure/path/$', 'secure_view', {'SSL':True}),
)
```

You can always ensure a view is not served over SSL with `'SSL': True`

```python
urlpatterns = patterns('my_app.views',
url(r'^unsecure/path/$', 'secure_view', {'SSL': False}),
)
```

Settings
--------
`SSL_ON (default True)`
Use SSL redirects. This setting overrides all other settings.

`SSL_ALWAYS (default False)`
Use SSL throughout the entire site.

`HTTPS_PATHS (default [])`
A list of secure paths.

`SSL_PORT (default None)`
Port number of the SSL connection. If the value is not None it will be appended after the host.

Metadata

Release files for django-ssl-redirect 2.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-ssl-redirect 2.1.1
File Size Uploaded
django-ssl-redirect-2.1.1.tar.gz 3.9 kB Details

Release files / django-ssl-redirect-2.1.1.tar.gz

Download URL django-ssl-redirect-2.1.1.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b46f4c1bb569d2f75d06ad30a574810e12c2be27f56e5385c43721cf13af575f
BLAKE2b-256 checksum
How to use checksums
0f627f74b85538bb4b51efab40a4aed8916c6b79c7f3a62e420c56ed92823bb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

2.2

1 release file

This release

2.1.1 This release

1 release file

2.1

1 release file

2.0

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page