Skip to content Skip to sidebar Skip to footer

After Upgrade To Django 1.11 Append_slash No Longer Works

In Django 1.9 (and Python 3.4) the default of APPEND_SLASH worked correctly, i.e. I could enter 'localhost:8000/ideatree/videos' and the trailing slash would be added. After an upg

Solution 1:

Django introduced new middleware in Django 1.10. You should use the MIDDLEWARE setting if you are using new-style middleware, and MIDDLEWARE_CLASSES if you are using old-style middleware.

If you are using Django 1.10 or 1.11, then the old MIDDLEWARE_CLASSES setting is still supported, so Django should continue to redirect with the appended slash.

However, once you upgrade to Django 2.0, the MIDDLEWARE_CLASSES setting is ignored and you must switch over to MIDDLEWARE.

When you switch over to MIDDLEWARE, you should remove SessionAuthenticationMiddleware since it has no effect in 1.10 and 1.11, and is removed completely in Django 2.0.


Post a Comment for "After Upgrade To Django 1.11 Append_slash No Longer Works"