Is there a simple way in Django to redirect everything from a non-www domain to the version with it? I mean from http://example.com to http://www.example.com.
I have it. This is PREPEND_WWW in the settings.
https://docs.djangoproject.com/en/dev/ref/settings/?from=olddocs#prepend-www
How to say docs
If PREPEND_WWW is True, URLs that do not have a leading "www." will be redirected to the same URL with the leading "www."
By default, PREPEND_WWW set to False . You can change this value to True in the settings.
PREPEND_WWW
False
PREPEND_WWW = True
To do this, you must enable CommonMiddleware in your resellers.
MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', )
You can also skip the prefix through the correct DNS configuration.