A Django middleware application that removes the WWW subdomain
Project description
Django Remove WWW is a Django middleware application that removes the WWW subdomain.
The middleware inspects the request’s host for the www subdomain, and redirects if REMOVE_WWW is True. It silently passes if PREPEND_WWW is also True. For some reason, Django won’t include a REMOVE_WWW setting. Thanks to Daniel Ryan’s GitHub Gist for some inspiration.
Install
$ pip install django-removewww
Add to settings.py.
MIDDLEWARE = [
# ...
'removewww.middleware.RemoveWwwMiddleware',
]
REMOVE_WWW = True
Adding to INSTALLED_APPS is unnecessary unless you want to run the tests.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django-removewww-0.1.2.tar.gz.
File metadata
- Download URL: django-removewww-0.1.2.tar.gz
- Upload date:
- Size: 3.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6200f79971db313e55e851a306aef4590b8e8fa550c1d067cd389381a1bf806d
|
|
| MD5 |
f5691ecbf718d6d3e4f4e79020cca99a
|
|
| BLAKE2b-256 |
bd8f8c9440c9ac91dd1a75f9134a3bcf77977dbdc83474bed219e32db69866bf
|
File details
Details for the file django_removewww-0.1.2-py2.py3-none-any.whl.
File metadata
- Download URL: django_removewww-0.1.2-py2.py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
029d2dfcd4452c250f7f076b5595eefe67f4293ebd89c8a778c4bbb251e36fdb
|
|
| MD5 |
f9b360031c9fd54bb0cf5d2c8a6e1d68
|
|
| BLAKE2b-256 |
d68a56b091318a7d09d2f34911f0e99defa2d45776d0b602261f09e5f644906f
|