In Django 3.0 this gives the 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.
How should I change url(r'^admin/', include(admin.site.urls))
? I tried to look at the documentation,
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^hello/', include(myapp.views)),
]
remove include from admin urls and use path
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('hello/', include('myapp.views')),
]
refer this django 3 doc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With