4
Django URLs TypeError:对于include(),视图必须是可调用的或列表/元组
升级到Django 1.10后,出现错误: TypeError: view must be a callable or a list/tuple in the case of include(). 我的urls.py如下: from django.conf.urls import include, url urlpatterns = [ url(r'^$', 'myapp.views.home'), url(r'^contact/$', 'myapp.views.contact'), url(r'^login/$', 'django.contrib.auth.views.login'), ] 完整的回溯是: Traceback (most recent call last): File "/Users/alasdair/.virtualenvs/django110/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper fn(*args, **kwargs) File "/Users/alasdair/.virtualenvs/django110/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 121, …