查看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

最新文章

  1. 真实记录疑似Linux病毒导致服务器 带宽跑满的解决过程
  2. 自动打开Accesibility Service 可以自动安装APP
  3. PHP从零开始-笔记-面向对象编程的概念
  4. highcharts相关属性
  5. 【ASP.NET MVC】"[A]System.Web.WebPages.Razor.Configuration.HostSection 无法强制转换为 ..."的解决办法
  6. 栈的应用1——超级计算器(中缀与后缀表达式)C语言
  7. 关于SqlParameter中IN子句查询的问题
  8. eclipse 导入项目时候java版本不一致问题
  9. PSAM卡
  10. 汉字转拼音 oracle方式 [转]
  11. C#跨窗体调用控件(委托回调函数使用例子)
  12. Maven项目管理工具
  13. [原创]Zynq AXI-CDMA的使用
  14. selenium-判断元素是否可见(五)
  15. Tomcat 控制台UTF-8乱码问题
  16. preparedstatement 为什么可以防止sql注入
  17. nginx 配置 非80 的其他 端口
  18. [翻译] LASIImageView - 显示进度指示并异步下载图片
  19. CSS——你所不知的 CSS ::before 和 ::after 伪元素用法(转)
  20. VMWARE虚拟机中CentOs7网络连接

热门文章

  1. Java集合中迭代器的常用用法
  2. tomcat环境配置 Linux 与 Windows
  3. linux 添加ftp用户与登录配置详解
  4. android使用JSON数据和服务器进行交互
  5. R实战 第五篇:绘图(ggplot2)
  6. 微信小程序快捷键
  7. ccd引脚
  8. 使用Python解析豆瓣上Json格式数据
  9. Java环境变量,真的还有必要配吗?
  10. 13.HashMap TreeMap HashTable LinkedHashMap 的区别