Django运行不提示网址问题

问题描述:运行django项目不提示网址信息,也就是web没有起来,无法访问。

(my-venv-3.8) PS D:\Project\MyGitCode\public\it_blog\blog> python .\manage.py runserver
INFO autoreload 636 Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).

django运行结果如上,这是一个不正常的结果,没有提示网址访问信息,已经是第2次出现,昨天大约是20分钟左右自动恢复,原因是数据库连接不上:

bash 复制代码
## 问题排查
一直不提示访问地址是因为Django没有正常启动,可能是因为后台数据库那个时候卡住的原因。
INFO 2024-05-01 17:20:24,786 autoreload 636 Watching for file changes with StatReloader
INFO 2024-05-01 17:22:04,914 autoreload 250 D:\Project\MyGitCode\public\it_blog\blog\templates\register.html changed, reloading.
INFO 2024-05-01 17:22:06,095 autoreload 636 Watching for file changes with StatReloader
INFO 2024-05-01 17:23:05,332 autoreload 636 Watching for file changes with StatReloader
INFO 2024-05-01 17:25:46,883 autoreload 250 D:\Project\MyGitCode\public\it_blog\blog\templates\register.html changed, reloading.
INFO 2024-05-01 17:25:48,502 autoreload 636 Watching for file changes with StatReloader
INFO 2024-05-01 17:26:36,762 autoreload 636 Watching for file changes with StatReloader
INFO 2024-05-01 17:27:10,945 autoreload 250 D:\Project\MyGitCode\public\it_blog\blog\templates\register.html changed, reloading.
INFO 2024-05-01 17:27:12,240 autoreload 636 Watching for file changes with StatReloader
INFO 2024-05-01 17:29:32,382 autoreload 636 Watching for file changes with StatReloader
INFO 2024-05-01 17:32:41,813 autoreload 636 Watching for file changes with StatReloader
INFO 2024-05-01 17:38:36,847 autoreload 636 Watching for file changes with StatReloader
INFO 2024-05-01 17:42:11,890 autoreload 636 Watching for file changes with StatReloader

接着我与大师进行了交流,它也给出了一些可能的建议,其中就有提到数据库问题:

  1. Check for errors : Look for any error messages in the console output that might indicate why the server isn't starting properly. It could be a syntax error in your code, a database issue, or a missing migration.

  2. Verbose output: Run the command with verbosity set to 3 for more detailed output:

    bash 复制代码
    python manage.py runserver --verbosity 3
  3. Restart your environment: If nothing seems to work, try restarting your development environment (terminal, code editor, or even your computer) to reset any processes that might be causing conflicts.

  4. Review project settings : Check if there's something in your Django project that's causing issues with the server start-up. It could be in settings.py, middleware, or a custom configuration.

今天还是一样的问题,数据库直接OOM了,无奈之下只能重启了服务器。后期解决方案是迁移数据库服务器,多分配一点资源。

相关推荐
_.Switch3 分钟前
Python 自动化运维持续优化与性能调优
运维·开发语言·python·缓存·自动化·运维开发
伏虎山真人3 分钟前
开源数据库 - mysql - mysql-server-8.4(gtid主主同步+ keepalived热切换)部署方案
数据库·mysql·开源
J不A秃V头A9 分钟前
Python爬虫:获取国家货币编码、货币名称
开发语言·爬虫·python
阿斯卡码2 小时前
jupyter添加、删除、查看内核
ide·python·jupyter
FIN技术铺3 小时前
Redis集群模式之Redis Sentinel vs. Redis Cluster
数据库·redis·sentinel
埃菲尔铁塔_CV算法4 小时前
图像算法之 OCR 识别算法:原理与应用场景
图像处理·python·计算机视觉
CodingBrother4 小时前
MySQL 中的 `IN`、`EXISTS` 区别与性能分析
数据库·mysql
封步宇AIGC4 小时前
量化交易系统开发-实时行情自动化交易-3.4.2.Okex行情交易数据
人工智能·python·机器学习·数据挖掘
封步宇AIGC4 小时前
量化交易系统开发-实时行情自动化交易-2.技术栈
人工智能·python·机器学习·数据挖掘
代码小鑫4 小时前
A027-基于Spring Boot的农事管理系统
java·开发语言·数据库·spring boot·后端·毕业设计