Can't View Django 2.0 Admin Page After Upgrading
Solution 1:
You haven't switched from the old-style middleware MIDDLEWARE_CLASSES
to the new-style middleware MIDDLEWARE
. You get the 404 because your project is defaulting to MIDDLEWARE = []
, so the redirect to append the slash (e.g /admin
-> `/admin/) isn't happening).
Note that Django 1.7 to 2.0 is a big jump. You may find it easier to go via 1.8 and 1.11 (which is LTS and still supported) first. In this case, Django 1.11 supports MIDDLEWARE_CLASSES
and MIDDLEWARE
, so you can get your app working on Django 1.11 with MIDDLEWARE_CLASSES
, switch to MIDDLEWARE
to fix the deprecation warning, and then you're in a better position to upgrade to Django 2.0.
Note that you can still use url()
in Django 2.0, so you don't have to rewrite your URL patterns to use path()
until you've got the rest of the project working.
Post a Comment for "Can't View Django 2.0 Admin Page After Upgrading"