当我尝试访问管理部分时,Django网络服务器会在本地服务器上自动关闭 [英] Django webserver automatically shuts off on local server when I try to access the admin section
问题描述
我是一个初学者,我是第一次尝试学习Django,我在Windows 10上的virtualenv中创建了一个项目。在开始运行''python之后,我能够登录到admin部分,效果很好。 manage.py runserver'''
但是现在当我运行相同的命令时,我可以看到Django登陆页面,但是只要我尝试点击
有关于此问题的票证: https://code.djangoproject.com/ticket/31067 。
这似乎是Python 3.7.0中的错误,并且似乎已在Python 3.7.1中修复。
由于Django官方仅支持Python系列的最新补丁程序发布,因此该错误不会在Django中得到修复。
您可以将Python版本升级到最新的3.7补丁程序,也可以将Django降级到2.2。
I'm a noob trying to learn Django for the first time, I created a project in a virtualenv on Windows 10. It worked well in the beginning where I was able to login to the admin section after running '''python manage.py runserver'''
But now when I run the same command I'm able to see the Django landing page but as soon as I try to hit http://localhost:8000/admin/ or http://127.0.0.1:8000/admin the server automatically disconnects and I get the "This site can’t be reached" error on Chrome.
I tried changing the port number by running python manage.py runserver 0.0.0.0:8001
but it didn't work. I tried to check if the port (8000) is currently in use by running the cmd (as an admin) netstat -a -b
but couldn't find any issues.
The server just quits without any error message
Edit: Currently using Python 3.7.0 and django-3.0.1
There's a ticket about this issue: https://code.djangoproject.com/ticket/31067.
This seems to be a bug in Python 3.7.0, and appears to be fixed in Python 3.7.1. It's still unknown what the exact trigger is for this bug.
Since Django officially only supports the latest patch release of a Python series, this won't be fixed in Django. You can either upgrade your Python version to the latest patch release of 3.7, or downgrade Django to 2.2.
这篇关于当我尝试访问管理部分时,Django网络服务器会在本地服务器上自动关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!