如何解决在处理请求期间发生的Django异常

时间:2020-08-19 02:37:42

标签: django

您好,所以我很想了解可能导致此错误的原因,因此我的API使用Django,前端使用ReactJS。

因此,当我启动React时,主页立即向服务器端发出 GET 请求,以便从数据库中获取信息,但是现在当我在React中的页面之间切换时,我的API抱怨出现此错误:

Exception happened during processing of request from ('127.0.0.1'.50368)

我得到以下回溯:

  Traceback (most recent call last):
  File "C:\Python38\lib\socketserver.py", line 650, in process_request_thread
    self.finish_request(request, client_address)
  File "C:\Python38\lib\socketserver.py", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "C:\Python38\lib\socketserver.py", line 720, in __init__
    self.handle()
  File "C:\Users\JUNIOR\Django Projects\uwcLectureApi\project\lib\site-packages\django\core\servers\basehttp.py", line 174, in handle
    self.handle_one_request()
  File "C:\Users\JUNIOR\Django Projects\uwcLectureApi\project\lib\site-packages\django\core\servers\basehttp.py", line 182, in handle_one_request
    self.raw_requestline = self.rfile.readline(65537)
  File "C:\Python38\lib\socket.py", line 669, in readinto
    return self._sock.recv_into(b)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host

所以我不明白这里发生了什么以及如何解决这个问题,请您帮忙

0 个答案:

没有答案