gpt4 book ai didi

python - Django 管理服务器在 127.0.0.1 :/admin/URL is hit 时关闭

转载 作者:行者123 更新时间:2023-12-04 10:55:32 25 4
gpt4 key购买 nike

使用 Django 文档开发我的第一个 Django 项目 https://docs.djangoproject.com/en/3.0/intro/tutorial02/

我已经进入管理部分,但任何时候我都会进入 /admin/ Django 服务器关闭,没有错误消息(如按 CTRL + C)。

我试过的
1. 在不同的端口上运行服务器
2.新建一个Django项目
3.从任务管理器停止python进程

这让我发疯了,因为当我转到 127.0.0.1:<port>/app/index 时它工作正常
但服务器关闭时

以下是 Django 服务器日志

File ...Python\Python37-32\Lib\stringprep.py first seen with mtime 1530068518.0
File ...Lib\site-packages\django\contrib\auth\migrations\0001_initial.py first seen with mtime 1575315232.7083857
File ...Lib\site-packages\django\contrib\auth\migrations\0004_alter_user_username_opts.py first seen with mtime 1575315232.7103803
File ...Lib\site-packages\django\contrib\admin\migrations\__init__.py first seen with mtime 1575315232.064109
File ...Lib\site-packages\django\contrib\contenttypes\migrations\0001_initial.py first seen with mtime 1575315232.9317892
File ...Lib\site-packages\django\contrib\auth\migrations\0005_alter_user_last_login_null.py first seen with mtime 1575315232.711378
File ...Lib\site-packages\PIL\_imaging.cp37-win32.pyd first seen with mtime 1575317072.293999
File ...Lib\site-packages\django\contrib\admin\templatetags\admin_list.py first seen with mtime 1575315232.244624
File ...Lib\site-packages\django\contrib\auth\migrations\0009_alter_user_last_name_max_length.py first seen with mtime 1575315232.7153673
File ...Lib\site-packages\django\contrib\auth\migrations\0003_alter_user_email_max_length.py first seen with mtime 1575315232.709383
(0.000) SELECT "django_session"."session_key", "django_session"."session_data", "django_session"."expire_date" FROM "django_session" WHERE ("django_session"."expire_date" > '2019-12-08 00:29:28.033564' AND "django_session"."session_key" = '2okb8vdor5ydpa06vd97opvzhuqyxt51') LIMIT 21; args=('2019-12-08 00:29:28.033564', '2okb8vdor5ydpa06vd97opvzhuqyxt51')
(0.000) SELECT "auth_user"."id", "auth_user"."password", "auth_user"."last_login", "auth_user"."is_superuser", "auth_user"."username", "auth_user"."first_name", "auth_user"."last_name", "auth_user"."email", "auth_user"."is_staff", "auth_user"."is_active", "auth_user"."date_joined" FROM "auth_user" WHERE "auth_user"."id" = 1 LIMIT 21; args=(1,)

最佳答案

它是 Django 3.0 的问题,很多人都遇到了同样的问题。尝试降级到另一个版本,2.2 有效

关于python - Django 管理服务器在 127.0.0.1 :<port>/admin/URL is hit 时关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59231137/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com