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了,无奈之下只能重启了服务器。后期解决方案是迁移数据库服务器,多分配一点资源。

相关推荐
l1t2 小时前
利用DeepSeek实现服务器客户端模式的DuckDB原型
服务器·c语言·数据库·人工智能·postgresql·协议·duckdb
酷飞飞5 小时前
Python网络与多任务编程:TCP/UDP实战指南
网络·python·tcp/ip
MarkHard1236 小时前
如何利用redis使用一个滑动窗口限流
数据库·redis·缓存
数字化顾问7 小时前
Python:OpenCV 教程——从传统视觉到深度学习:YOLOv8 与 OpenCV DNN 模块协同实现工业缺陷检测
python
学生信的大叔8 小时前
【Python自动化】Ubuntu24.04配置Selenium并测试
python·selenium·自动化
island13148 小时前
【Redis#10】渐进式遍历 | 数据库管理 | redis_cli | RES
数据库·redis·bootstrap
心想事成的幸运大王8 小时前
Redis的过期策略
数据库·redis·缓存
倔强的石头_8 小时前
CentOS 上安装KingbaseES(ISO包)详细教程
数据库
计算机编程小央姐8 小时前
跟上大数据时代步伐:食物营养数据可视化分析系统技术前沿解析
大数据·hadoop·信息可视化·spark·django·课程设计·食物
2401_897930069 小时前
使用Docker轻松部署Neo4j图数据库
数据库·docker·neo4j