DJANGO: TypeError: view必须是一个可调用对象,或者在include()的情况下是一个列表/元组.&



我得到以下django错误:

File "C:UsersUSERDesktopPythonCarRentalSystemsystemurls.py", line 6, in <module>
url(r'^$', 'system.views.home', name = "home"),
File "C:UsersUSERDesktopPythonlibsite-packagesdjangoconfurls__init__.py", line 13, in url
return  re_path(regex, view, kwargs, name)
File "C:UsersUSERDesktopPythonlibsite-packagesdjangourlsconf.py", line 73, in _path
raise TypeError('view must be a callable or a list/tuple in the case of include().')
TypeError: view must be a callable or a list/tuple in the case of include().

system/urls.py的第6行应该是url(r'^$', system.views.home, name = "home")(之前已经导入了system)。url不解析字符串(虚线路径)到实际对象

你可能正在处理very旧项目:该特性在Django 1.10中被弃用并被删除(7年前;最新版本是Django 4.0): changelog.