当前位置: 首页 > news >正文

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分钟左右自动恢复,原因是数据库连接不上:

## 问题排查
一直不提示访问地址是因为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:

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

http://www.lryc.cn/news/341803.html

相关文章:

  • web安全---xss漏洞/beef-xss基本使用
  • 第一天学习(GPT)
  • 【C++之AVL树旋转操作的详细图解】
  • 制作Android分区镜像
  • 如何代码激活service——packageKit 系统更新番外
  • 音视频常用工具
  • 周刊是聪明人筛选优质知识的聪明手段!
  • 设计模式Java实现-建造者模式
  • 微博视频怎么下载无水印
  • 为什么要梯度累积
  • 知识图谱在提升大语言模型性能中的应用:减少幻觉与增强推理的综述
  • P8800 [蓝桥杯 2022 国 B] 卡牌
  • MySQL商城数据表(80-84)
  • 使用Gitbook生成电子书
  • 设计模式之传输对象模式
  • Re69:读论文 LaMDA: Language Models for Dialog Applications
  • 算法学习:二分查找
  • github提交代码失败解决方案
  • 连锁收银系统总仓到门店库存调拨操作教程
  • 公网tcp转流
  • 【Linux 基础 IO】文件系统
  • Chrome浏览器安装React工具
  • React常用组件分享
  • JSON原生AJAX
  • Go图片列表
  • 1.4 初探JdbcTemplate操作
  • React 第二十一章 Portals
  • ADS基础教程9-理想模型和厂商模型实现及对比
  • 从零开始学AI绘画,万字Stable Diffusion终极教程(二)
  • electron 通信总结