django 请求接口报错

问题相关代码,请勿粘贴截图

from rest_framework.views import APIView
from rest_framework.response import Response

class LoginView(APIView):

def post(self, request, *args, **kwargs):
    print(request.data)
    return Response({"status": True})
运行结果及报错内容

Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Users\hulijing\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1009, in _bootstrap_inner
self.run()
File "C:\Users\hulijing\AppData\Local\Programs\Python\Python310\lib\threading.py", line 946, in run
self._target(*self._args, **self.kwargs)
File "C:\Users\hulijing\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "C:\Users\hulijing\AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\management\commands\runserver.py", line 134, in inner_run
self.check(display_num_errors=True)
File "C:\Users\hulijing\AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\management\base.py", line 487, in check
all_issues = checks.run_checks(
File "C:\Users\hulijing\AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\checks\registry.py", line 88, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "C:\Users\hulijing\AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\checks\urls.py", line 14, in check_url_config
return check_resolver(resolver)
File "C:\Users\hulijing\AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\checks\urls.py", line 24, in check_resolver
return check_method()
File "C:\Users\hulijing\AppData\Local\Programs\Python\Python310\lib\site-packages\django\urls\resolvers.py", line 480, in check
for pattern in self.url_patterns:
File "C:\Users\hulijing\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\functional.py", line 49, in get
res = instance.dict[self.name] = self.func(instance)
File "C:\Users\hulijing\AppData\Local\Programs\Python\Python310\lib\site-packages\django\urls\resolvers.py", line 696, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "C:\Users\hulijing\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\functional.py", line 49, in get
res = instance.dict[self.name] = self.func(instance)
File "C:\Users\hulijing\AppData\Local\Programs\Python\Python310\lib\site-packages\django\urls\resolvers.py", line 689, in urlconf_module
return import_module(self.urlconf_name)
File "C:\Users\hulijing\AppData\Local\Programs\Python\Python310\lib\importlib_init
.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in call_with_frames_removed
File "D:\个人\Desktop\xiaochengxu_gjango\xiaochengxu_gjango\urls.py", line 7, in
path('api/', include('api.urls')),
File "C:\Users\hulijing\AppData\Local\Programs\Python\Python310\lib\site-packages\django\urls\conf.py", line 38, in include
urlconf_module = import_module(urlconf_module)
File "C:\Users\hulijing\AppData\Local\Programs\Python\Python310\lib\importlib_init
.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "D:\个人\Desktop\xiaochengxu_gjango\api\urls.py", line 5, in
url('login/', views.LoginView.as_view()),
File "C:\Users\hulijing\AppData\Local\Programs\Python\Python310\lib\site-packages\django\template\defaulttags.py", line 1368, in url
bits = token.split_contents()
AttributeError: 'function' object has no attribute 'split_contents'

貌似有好几个 关于 rest_framework 的问题了, 看的我一头雾水。

这个错误是如何出现的?
是启动web服务出现的吗?

python manage.py runserver 0.0.0.0:8000