常量python/django错误
有人知道我该怎么做吗?每次与本地主机交互时,我都会收到此错误 它没有崩溃,我的终端只是在这些例外情况下爆炸。有人知道我应该如何处理这个问题吗 我知道这是很多错误,但我开始了解更多关于Django的信息,因此非常感谢您的帮助。谢谢大家!常量python/django错误,python,django,Python,Django,有人知道我该怎么做吗?每次与本地主机交互时,我都会收到此错误 它没有崩溃,我的终端只是在这些例外情况下爆炸。有人知道我应该如何处理这个问题吗 我知道这是很多错误,但我开始了解更多关于Django的信息,因此非常感谢您的帮助。谢谢大家! ---------------------------------------- Exception happened during processing of request from ('127.0.0.1', 50979) -----------------
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 50979)
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 50974)
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 50978)
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 50980)
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 50981)
Traceback (most recent call last):
Traceback (most recent call last):
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socketserver.py", line 650, in process_request_thread
self.finish_request(request, client_address)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socketserver.py", line 720, in __init__
self.handle()
File "/Users/Emmanuel/.local/share/virtualenvs/thepillow-kX0pGe6_/lib/python3.8/site-packages/django/core/servers/basehttp.py", line 174, in handle
self.handle_one_request()
File "/Users/Emmanuel/.local/share/virtualenvs/thepillow-kX0pGe6_/lib/python3.8/site-packages/django/core/servers/basehttp.py", line 182, in handle_one_request
self.raw_requestline = self.rfile.readline(65537)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socket.py", line 669, in readinto
return self._sock.recv_into(b)
ConnectionResetError: [Errno 54] Connection reset by peer
----------------------------------------
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socketserver.py", line 650, in process_request_thread
self.finish_request(request, client_address)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socketserver.py", line 650, in process_request_thread
self.finish_request(request, client_address)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socketserver.py", line 720, in __init__
self.handle()
File "/Users/Emmanuel/.local/share/virtualenvs/thepillow-kX0pGe6_/lib/python3.8/site-packages/django/core/servers/basehttp.py", line 174, in handle
self.handle_one_request()
File "/Users/Emmanuel/.local/share/virtualenvs/thepillow-kX0pGe6_/lib/python3.8/site-packages/django/core/servers/basehttp.py", line 182, in handle_one_request
self.raw_requestline = self.rfile.readline(65537)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socket.py", line 669, in readinto
return self._sock.recv_into(b)
ConnectionResetError: [Errno 54] Connection reset by peer
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socketserver.py", line 650, in process_request_thread
self.finish_request(request, client_address)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socketserver.py", line 720, in __init__
self.handle()
File "/Users/Emmanuel/.local/share/virtualenvs/thepillow-kX0pGe6_/lib/python3.8/site-packages/django/core/servers/basehttp.py", line 174, in handle
self.handle_one_request()
File "/Users/Emmanuel/.local/share/virtualenvs/thepillow-kX0pGe6_/lib/python3.8/site-packages/django/core/servers/basehttp.py", line 182, in handle_one_request
self.raw_requestline = self.rfile.readline(65537)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socket.py", line 669, in readinto
return self._sock.recv_into(b)
ConnectionResetError: [Errno 54] Connection reset by peer
----------------------------------------
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socketserver.py", line 720, in __init__
self.handle()
File "/Users/Emmanuel/.local/share/virtualenvs/thepillow-kX0pGe6_/lib/python3.8/site-packages/django/core/servers/basehttp.py", line 174, in handle
self.handle_one_request()
File "/Users/Emmanuel/.local/share/virtualenvs/thepillow-kX0pGe6_/lib/python3.8/site-packages/django/core/servers/basehttp.py", line 182, in handle_one_request
self.raw_requestline = self.rfile.readline(65537)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socket.py", line 669, in readinto
return self._sock.recv_into(b)
ConnectionResetError: [Errno 54] Connection reset by peer
----------------------------------------
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socketserver.py", line 650, in process_request_thread
self.finish_request(request, client_address)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socketserver.py", line 720, in __init__
self.handle()
File "/Users/Emmanuel/.local/share/virtualenvs/thepillow-kX0pGe6_/lib/python3.8/site-packages/django/core/servers/basehttp.py", line 174, in handle
self.handle_one_request()
File "/Users/Emmanuel/.local/share/virtualenvs/thepillow-kX0pGe6_/lib/python3.8/site-packages/django/core/servers/basehttp.py", line 182, in handle_one_request
self.raw_requestline = self.rfile.readline(65537)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socket.py", line 669, in readinto
return self._sock.recv_into(b)
ConnectionResetError: [Errno 54] Connection reset by peer
----------------------------------------
----------------------------------------
Not Found: /favicon.ico
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 50982)
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socketserver.py", line 650, in process_request_thread
self.finish_request(request, client_address)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socketserver.py", line 720, in __init__
self.handle()
File "/Users/Emmanuel/.local/share/virtualenvs/thepillow-kX0pGe6_/lib/python3.8/site-packages/django/core/servers/basehttp.py", line 174, in handle
self.handle_one_request()
File "/Users/Emmanuel/.local/share/virtualenvs/thepillow-kX0pGe6_/lib/python3.8/site-packages/django/core/servers/basehttp.py", line 182, in handle_one_request
self.raw_requestline = self.rfile.readline(65537)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socket.py", line 669, in readinto
return self._sock.recv_into(b)
ConnectionResetError: [Errno 54] Connection reset by peer
'''
这个问题是由fav.ico提出的,因为django服务器总是在找不到favicon后重置,所以如果添加一个favicon。即使您从未显式地加载一个,django也会尝试从项目的根目录加载一个默认的。您可以使用创建一个简单的fav图标。将其放在静态文件夹中,并按如下方式加载:
{% load static %}
<head>
<link rel="shortcut icon" href="{% static 'images/favicon.ico' %}" />
{%load static%}
fav.ico会提出这个问题,因为django服务器总是在找不到favicon后重置,所以如果添加一个favicon。即使您从未显式地加载一个,django也会尝试从项目的根目录加载一个默认的。您可以使用创建一个简单的fav图标。将其放在静态文件夹中,并按如下方式加载:
{% load static %}
<head>
<link rel="shortcut icon" href="{% static 'images/favicon.ico' %}" />
{%load static%}
首先,请添加项目的树。我在mac book pro上使用树时遇到问题。如果有帮助,请参阅以下内容:/users/emmanuel/desktop/APPFOLDER/users/emmanuel/desktop/APPFOLDER/APPNAME/users/emmanuel/desktop/APPFOLDER/APPNAME/migrations/users/emmanuel/desktop/APPFOLDER/templates/emmanuel/desktop/APPFOLDER/APPFOLDER/APPNAME/users/emmanuel/desktop/APPFOLDER/media/users/emmanuel/desktop/APPFOLDER/media/profile_pics添加html页面的标记,显然问题在于找不到:/favicon.ico谢谢!那么所有ConnectionResetErrors呢[Errno 54]peerI的连接重置将发布答案以及解释,以供将来参考,您可以接受。首先,您可以添加项目树。我在mac book pro上使用树时遇到问题。如果有帮助,请参阅以下内容:/users/emmanuel/desktop/APPFOLDER/users/emmanuel/desktop/APPFOLDER/APPNAME/users/emmanuel/desktop/APPFOLDER/APPNAME/migrations/users/emmanuel/desktop/APPFOLDER/templates/emmanuel/desktop/APPFOLDER/APPFOLDER/APPNAME/users/emmanuel/desktop/APPFOLDER/media/users/emmanuel/desktop/APPFOLDER/media/profile_pics添加html页面的标记,显然问题在于找不到:/favicon.ico谢谢!那么所有ConnectionResetErrors呢peerI的[Errno 54]连接重置将发布答案以及解释,以供将来参考,您可以接受