django启动uwsgi报错

查看uwsgi.log

*** Starting uWSGI 2.0.17 (64bit) on [Thu Apr  5 17:46:15 2018] ***
compiled with version: 4.4.7 20120313 (Red Hat 4.4.7-18) on 05 April 2018 02:08:03
os: Linux-2.6.32-642.6.2.el6.x86_64 #1 SMP Wed Oct 26 06:52:09 UTC 2016
nodename: GDJ_DEV
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /xxx/xxx/xxx/xxx
writing pidfile to uwsgi.pid
detected binary path: /xxx/xxx/.virtualenvs/h1/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
chdir() to /xxx/xxx/xxx/xxx
your processes number limit is 100000
your memory page size is 4096 bytes
detected max file descriptor number: 100000
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uWSGI http bound on 172.21.0.5:8000 fd 4
uwsgi socket 0 bound to TCP address 127.0.0.1:33522 (port auto-assigned) fd 3
Python version: 3.6.4 (default, Mar 24 2018, 10:32:21)  [GCC 4.4.7 20120313 (Red Hat 4.4.7-18)]
Python main interpreter initialized at 0x1ff10d0
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 416880 bytes (407 KB) for 8 cores
*** Operational MODE: preforking+threaded ***
failed to open python file xxx/uwsgi.ini
unable to load app 0 (mountpoint=‘‘) (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 4865)
spawned uWSGI worker 1 (pid: 4866, cores: 2)
spawned uWSGI worker 2 (pid: 4867, cores: 2)
spawned uWSGI worker 3 (pid: 4868, cores: 2)
spawned uWSGI worker 4 (pid: 4869, cores: 2)
spawned uWSGI http 1 (pid: 4870)
--- no python application found, check your startup logs for errors ---
[pid: 4869|app: -1|req: -1/1] 118.26.10.242 () {40 vars in 777 bytes} [Thu Apr  5 17:46:31 2018] GET /user/login/ => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)

解决第一个报错,注意操作的先后顺序:

1.卸载uwsgi

pip uninstall uwsgi

#注意此时卸载,pip会有缓存留在系统里

2.安装pcre支持库

yum install pcre pcre-devel pcre-static

3.继续安装uwsgi,不走pip缓存

pip install uwsgi -I --no-cache-dir

#启动uwsgi,已经没有“!!! no internal routing support, rebuild with pcre support !!!”报错了

解决第二个报错:

需要在你的uwsgi.ini文件中module指定项目下面的wsgi:

module=xxx.wsgi

#注:xxx为项目名称,startproject那个项目名称,这个错误解决后,下面的访问错误自然而然的就解决了!

附:我的uwsgi.ini配置文件

[uwsgi]
#socket=ip:port             #使用nginx代理请求时配置,直接访问uwsgi使用http方式
http=ip:port
chdir=/xxx/xxx              #项目根目录的绝对路径
wsgi-file=xxx/uwsgi.ini    #项目目录下的uwsgi.ini
module=xxx.wsgi           #指向项目下的wsgi模块
processes=4
threads=2
master=True
py-atuo-reload=1
env=DJANGO_SETTINGS_MODULE=xxx.settings
pidfile=uwsgi.pid
daemonize=uwsgi.log

原文地址:https://www.cnblogs.com/sexyboy/p/8723687.html

时间: 2024-11-09 10:49:29

django启动uwsgi报错的相关文章

django启动server报错Error: That port is already in use.

这种一般是端口错误,一般是要把端口关掉,这里提供了两种方法. 方法一:直接命令: sudo lsof -t -i tcp:8000 | xargs kill -9 方法二:脚本:名字manage.py 直接运行:./manage.py runserver 即可 #!/bin/bash pid=$(ps aux | grep "./manage.py runserver" | grep -v grep | head -1 | xargs | cut -f2 -d" "

Django——模版Template报错

>>> from django.template import Template >>> t = Template("My name is {{ my_name }}.") Traceback (most recent call last): File "C:\Python33\lib\site-packages\django\conf\__init__.py", line 38, in _setup settings_modul

记一次django的诡异报错 Could not parse the remainder: '=' from '='

如题,一个展示日志的功能,调用该模板文件时报错,Could not parse the remainder: '=' from '='.这行模板语言在上面出现过同样的,仅仅是改了'<='右端的整数大小,而且该有的标签也不少. 百般思考无解,stackoverflow和百度都没答案.后来重新看了下开发文档,发现是Django的版本不对,开发时用的1.8.2,我部署时用的1.11.5.重新安装低版本的django后问题解决.但原因仍待查. 记一次django的诡异报错 Could not parse

windows平台在tomcat中启动cas报错解决

windows平台在tomcat中启动cas报错: Caused by: java.lang.UnsatisfiedLinkError: Could not load library. Reasons: [no jansi in java.library.path, 系统找不到指定的路径.] 解决办法:将jansi.dll文件放到C:\Windows\System32目录下即可. 注意:jansi.dll文件在使用gradle编译打包cas时会下载到C:\Users\${用户名}\.gradle

436启动cman报错

rhel6.2启动cman报错 Waiting for quorum... Timed-out waiting for cluster 解决方法: 修改/etc/init.d/cman配置文件 vim /etc/init.d/cman CMAN_QUORUM_TIMEOUT=45 改为 CMAN_QUORUM_TIMEOUT=0 然后重启cman即可

Linux系统下启动MySQL报错:Neither host &#39;localhost.localdomain&#39; nor &#39;localhost&#39; could be looked up with

Linux系统下启动MySQL报错:Neither host 'localhost.localdomain' nor 'localhost' could be looked up with 摘要 Linux系统下安装完MySQL,启动MySQL报错:Neither host 'localhost.localdomain' nor 'localhost' could be looked up with... Linux系统下装完MySQL,然后重启动时报错: 解决方法:  查看cat /etc/h

Django urls.py报错: raise TypeError(&#39;view must be a callable or a list/tuple in the case of include()

Django urls.py报错: raise TypeError('view must be a callable or a list/tuple in the case of include() 报错信息 "F:\PyCharm 2016.2.2\bin\runnerw.exe" C:\Users\Administrator\AppData\Local\Programs\Python\Python35\python.exe F:/Django/blogs/manage.py run

启动Myeclipse报错“Failed to create the Java Virtual Machine”的解决办法

我安装的是Myeclipse 10.7.1.装上好久没用,今天启动突然报错:Failed to create the Java Virtual Machine. 检查Myeclipse安装好使用时好的啊,近期也没用,可能是近期升级了本地单独安装的jre版本导致的吧(Myeclipse使用自己的jre的). 整理了如下2个解决办法,可以选择一个使用,我选择的是第2个.经测试都ok. 方法一: 找到Myeclpise路径下的myeclipse.ini文件: 编辑将Xmx(JVM Heap最大允许的尺

ceph升级到10.2.3 版本启动服务报错:Unknown lvalue &#39;TasksMax&#39; in section &#39;Service&#39;

#### ceph软件包升级完成,执行命令重启服务 sudo systemctl restart [email protected]"$HOSTNAME" #### 故障现象 服务可以启动,启动后显示有报错信息: Nov 23 17:14:45 ceph-6-12 systemd[1]:        [/usr/lib/systemd/system/[email protected]:18] Unknown lvalue 'TasksMax' in section 'Service'