Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/281.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Django我怎样才能追溯这个电话是在哪里打的_Python_Django_Django Socialauth_Graphene Python - Fatal编程技术网

Python Django我怎样才能追溯这个电话是在哪里打的

Python Django我怎样才能追溯这个电话是在哪里打的,python,django,django-socialauth,graphene-python,Python,Django,Django Socialauth,Graphene Python,自从我创建了一个新项目(Django 2.2和Python 3.7)以来,我每隔60年代定期打印这个错误 Not Found: /graphql [24/Sep/2019 13:23:50] "GET /graphql HTTP/1.1" 404 4216 ---------------------------------------- Exception happened during processing of request from ('127.0.0.1', 53701) Traceb

自从我创建了一个新项目(Django 2.2和Python 3.7)以来,我每隔60年代定期打印这个错误

Not Found: /graphql
[24/Sep/2019 13:23:50] "GET /graphql HTTP/1.1" 404 4216
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 53701)
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socketserver.py", line 650, in process_request_thread
    self.finish_request(request, client_address)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socketserver.py", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socketserver.py", line 720, in __init__
    self.handle()
  File "/Users/robertofernandez/KMH/flowlemon_backen/lib/python3.7/site-packages/django/core/servers/basehttp.py", line 171, in handle
    self.handle_one_request()
  File "/Users/robertofernandez/KMH/flowlemon_backen/lib/python3.7/site-packages/django/core/servers/basehttp.py", line 179, in handle_one_request
    self.raw_requestline = self.rfile.readline(65537)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socket.py", line 589, in readinto
    return self._sock.recv_into(b)
ConnectionResetError: [Errno 54] Connection reset by peer
我认为这个错误是由我安装的某个依赖项引起的(我没有任何视图或URL调用graphql,并且在我的项目中根本没有使用graphql),但我无法检测哪个包是导致问题的包

requirements.txt

attrs==19.1.0
certifi==2019.6.16
chardet==3.0.4
coreapi==2.3.3
coreschema==0.0.4
defusedxml==0.6.0
Django==2.2.4
django-braces==1.13.0
django-cors-headers==3.1.0
django-extensions==2.2.1
django-filter==2.2.0
django-oauth-toolkit==1.2.0
django-rest-framework-social-oauth2==1.1.0
djangorestframework==3.10.2
drf-yasg==1.16.1
idna==2.8
inflection==0.3.1
itypes==1.1.0
Jinja2==2.10.1
loguru==0.3.2
MarkupSafe==1.1.1
oauthlib==3.1.0
packaging==19.1
PyJWT==1.7.1
pyparsing==2.4.2
python-decouple==3.1
python3-openid==3.1.0
pytz==2019.2
requests==2.22.0
requests-oauthlib==1.2.0
ruamel.yaml==0.16.5
ruamel.yaml.clib==0.1.2
six==1.12.0
social-auth-app-django==3.1.0
social-auth-core==3.2.0
sqlparse==0.3.0
uritemplate==3.0.0
urllib3==1.25.3

你知道我该如何跟踪吗?

我的直觉是,是前端软件包导致了这个错误,因为Django软件包通常不需要向Django服务器发出HTTP请求。而且,它周期性地发生这一事实表明客户端轮询。例如,你可能有阿波罗的客户

要具体回答您的问题,您可以在
/graphql
添加一条路由,然后检查请求的客户机和推荐人

1) 使用到调试视图的临时路由更新
url.py

urlpatterns = [
    ...
    path('graphql', my_debug_view),
    ]
2) 使用
print
添加调试视图以在runserver控制台上显示请求信息

from django.http import HttpResponse

def my_debug_review(request):
    print(request.META)
    return HttpResponse("")
现在,您将看到关于请求的信息,而不是每60秒出现一次404错误


完成后,不要忘记删除这些更改。

你是对的,事实上,这是类似的,问题是来自另一个应用程序的服务人员。所以我花了一段时间才意识到这个问题