Redirects www URL address to non-www.
pip install django-redirect-to-non-www
pip install git+https://[email protected]/lukasvinclav/django-redirect-to-non-www.git
Open your settings file and append middleware redirect_to_non_www.middleware.RedirectToNonWww at the end of MIDDLEWARE list.
MIDDLEWARE = [
# Other middleware classes
'redirect_to_non_www.middleware.RedirectToNonWww',
]