Skip to content

Latest commit

 

History

History
65 lines (43 loc) · 1.85 KB

index.rst

File metadata and controls

65 lines (43 loc) · 1.85 KB

Django Remove WWW

PyPI version_ Build status_

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.

Contents

install documentation tests

Indices and tables

  • genindex
  • modindex
  • search