Answers for "typeerror: view must be a callable or a list/tuple in the case of include()."

0

typeerror: view must be a callable or a list/tuple in the case of include().

Your code is

urlpatterns = [
    url(r'^$', 'myapp.views.home'),
    url(r'^contact/$', 'myapp.views.contact'),
    url(r'^login/$', 'django.contrib.auth.views.login'),
]
change it to following as you're importing include() function :

urlpatterns = [
    url(r'^$', views.home),
    url(r'^contact/$', views.contact),
    url(r'^login/$', views.login),
]
Posted by: Guest on March-10-2022

Code answers related to "typeerror: view must be a callable or a list/tuple in the case of include()."

Python Answers by Framework

Browse Popular Code Answers by Language