Solving "django.core.exceptions.ImproperlyConfigured: Passing a 3-tuple to include()..." error after Django/Wagtail 2.0 upgrade

01 Mar · by Tim Kamanin · 1 min read

So you've upgraded to a new and shiny Django 2.0 (or Wagtail 2.0), start your server and boom, you got slapped by this error:

django.core.exceptions.ImproperlyConfigured: Passing a 3-tuple to include() is not supported. Pass a 2-tuple containing the list of patterns and app_name, and provide the namespace argument to include() instead.

Most probably, you have a problem in your main urls.py file:

url(r'^admin/', include(admin.site.urls)),

Do you see admin.site.urls wrapped by include(), this is what Django (Wagtail) isn't happy about. The solution is to register your Django admin route like this:

url(r'^admin/', admin.site.urls),

And now all should be fine. Let me know if it helps.

Want to get more 🔥 tips like this one?

Subscribe to get notified about new dev tutorials

Comments