Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

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.

Release History

Release History

This version
History Node

0.1.2

History Node

0.1.1

History Node

0.1

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django_removewww-0.1.2-py2.py3-none-any.whl (6.1 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Jul 17, 2017
django-removewww-0.1.2.tar.gz (3.2 MB) Copy SHA256 Checksum SHA256 Source Jul 17, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting