django异常日志_django uwsgi 错误日志分析例子

本文介绍了在启动 Django 项目时遇到的 uWSGI 异常日志问题,如 'failed to open python file' 和 'no app loaded',并指出这些问题通常由配置错误引起。通过日志定位到错误文件路径错误,解决方法是修正配置中的文件路径。此外,日志还显示了 uWSGI 运行在 root 用户下,提示使用 --uid 或其他选项以避免安全警告。在后续运行中,由于缓存问题导致路由错误,通过删除缓存或更换缓存键解决了问题。
摘要由CSDN通过智能技术生成

uwsgi 启动时就报错

一般能看到:--- no python application found, check your startup logs for errors ---,基本上是配置出错了,无法正常启动 uwsgi。

有用日志信息(每次启动 uwsgi 的时候就会有启动的日志产生,如果出错了就在这块找找):

*** Operational MODE: preforking ***

failed to open python file /root/yzq/djangos/testdata/Testdata/wsgi.py

unable to load app 0 (mountpoint='') (callable not found or import error)

它说 /root/yzq/djangos/testdata/Testdata/wsgi.py 这个路径打开失败,我这里是路径写错了,少写了一级。

*** Operational MODE: preforking ***

failed to open python file /root/yzq/djangos/testdata/Testdata/wsgi.py

unable to load app 0 (mountpoint='') (callable not found or import error)

*** no app loaded. going in full dynamic mode ***

uWSGI running as root, you can use --uid/--gid/--chroot options

*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***

*** uWSGI is running in multiple interpreter mode ***

spawned uWSGI master process (pid: 25141)

spawned uWSGI worker 1 (pid: 25142, cores: 1)

spawned uWSGI worker 2 (pid: 25143, cores: 1)

*** Stats server enabled on 127.0.0.1:9193 fd: 11 ***

...brutally killing workers...

worker 1 buried after 1 seconds

worker 2 buried after 1 seconds

binary reloading uWSGI...

chdir() to /root/yzq/configs

closing all non-uwsgi socket fds > 2 (max_fd = 100001)...

found fd 3 mapped to socket 0 (127.0.0.1:9092)

running /root/.virtualenvs/blog/bin/uwsgi

[uWSGI] getting INI configuration from /root/yzq/configs/testdata_uwsgi.ini

*** Starting uWSGI 2.0.17 (64bit) on [Fri Feb 15 21:31:14 2019] ***

compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-16) on 04 April 2018 04:11:16

os: Linux-3.10.0-514.26.2.el7.x86_64 #1 SMP Tue Jul 4 15:04:05 UTC 2017

nodename: VM_2_29_centos

machine: x86_64

clock source: unix

pcre jit disabled

detected number of CPU cores: 1

current working directory: /root/yzq/configs

detected binary path: /root/.virtualenvs/blog/bin/uwsgi

uWSGI running as root, you can use --uid/--gid/--chroot options

*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***

chdir() to /root/yzq/djangos/testdata

your processes number limit is 7283

your memory page size is 4096 bytes

detected max file descriptor number: 100001

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值