Django returning HTTP 301? Django returning HTTP 301? curl curl

Django returning HTTP 301?


You are probably requesting the URL without a trailing slash, and have APPEND_SLASH set to True (the default) in settings.py, so Django is redirecting to the URL including a slash.


My problem was PREPEND_WWW, when using it in localhost it returns a 301 error, I just created a local settings file and set it PREPEND_WWW = False


In my case, commenting the SecurityMiddleware on the settings.py file did the trick. I have to say that this only happens when running the runserver command (aka. when testing). With Apache it doesn't falls into the redirect loop.