原创博文 转载请注明出处!

uwsgi: unrecognized option '--http:8089'
uwsgi: unrecognized option '--http'
uwsgi trkMngm_uwsgi.ini -> invalid request block size: 21573 (max 4096)...skip
ModuleNotFoundError: No module named 'TrackManagement/TrackManagement/wsgi'
runserver运行django error : Bad Request
manage.py语法错误


uwsgi: unrecognized option '--http:8089'

(venv) [root@localhost TrackManagement]# uwsgi --http:8089 --module TrackManagement.wsgi
uwsgi: unrecognized option '--http:8089'
getopt_long() error


原因:
参数格式不对 :8089前面要加空格 uwsgi还在开启


uwsgi: unrecognized option '--http'

(venv) [root@localhost TrackManagement]# uwsgi --http:8089 --module TrackManagement.wsgi
uwsgi: unrecognized option '--http'
getopt_long() error


原因:
uwsgi还在开启 先杀了进程再重启


uwsgi trkMngm_uwsgi.ini -> invalid request block size: 21573 (max 4096)...skip
启动了之后每次访问

*** Stats server enabled on 127.0.0.1:9295 fd: 12 ***
invalid request block size: 21573 (max 4096)...skip
invalid request block size: 21573 (max 4096)...skip
invalid request block size: 21573 (max 4096)...skip
invalid request block size: 21573 (max 4096)...skip
invalid request block size: 21573 (max 4096)...skip
invalid request block size: 21573 (max 4096)...skip
invalid request block size: 21573 (max 4096)...skip
invalid request block size: 21573 (max 4096)...skip
invalid request block size: 21573 (max 4096)...skip
invalid request block size: 21573 (max 4096)...skip
invalid request block size: 21573 (max 4096)...skip
invalid request block size: 21573 (max 4096)...skip
invalid request block size: 21573 (max 4096)...skip
invalid request block size: 21573 (max 4096)...skip
invalid request block size: 21573 (max 4096)...skip
invalid request block size: 21573 (max 4096)...skip
invalid request block size: 21573 (max 4096)...skip
invalid request block size: 21573 (max 4096)...skip
invalid request block size: 21573 (max 4096)...skip
invalid request block size: 21573 (max 4096)...skip


原因:
trkMngm_uwsgi.ini 文件中有设置nginx的socket
如果这时候nginx没有对应的配置或者配置了但是nginx没有重启
就会产生这个错误


ModuleNotFoundError: No module named 'TrackManagement/TrackManagement/wsgi'

(venv) [root@localhost TrackManagement]# uwsgi --http :8089 --module TrackManagement/TrackManagement/wsgi.py
*** Starting uWSGI 2.0.18 (64bit) on [Tue Feb 19 11:33:20 2019] ***
compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-36) on 18 February 2019 05:28:03
os: Linux-3.10.0-957.1.3.el7.x86_64 #1 SMP Thu Nov 29 14:49:43 UTC 2018
nodename: localhost.localdomain
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 4
current working directory: /root/Odin/TrackManagement
detected binary path: /root/Odin/TrackManagement/venv/bin/uwsgi
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 63229
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uWSGI http bound on :8089 fd 4
spawned uWSGI http 1 (pid: 33181)
uwsgi socket 0 bound to TCP address 127.0.0.1:33454 (port auto-assigned) fd 3
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
Python version: 3.6.4 (default, Mar  6 2018, 13:19:57)  [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x12acbf0
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72920 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
ModuleNotFoundError: No module named 'TrackManagement/TrackManagement/wsgi'
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 worker 1 (and the only) (pid: 33180, cores: 1)


原因:
应该在TrackManagement项目里面运行 即这个目录下面

(venv) [root@localhost TrackManagement]# ls
db.sqlite3  manage.py  testUwsgi.py  TrackManagement


runserver运行django error : Bad Request

(venv) [root@localhost TrackManagement]# python manage.py runserver 0.0.0.0:8080
Performing system checks...System check identified no issues (0 silenced).You have 15 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.February 18, 2019 - 07:47:25
Django version 2.1.7, using settings 'TrackManagement.settings'
Starting development server at http://0.0.0.0:8080/
Quit the server with CONTROL-C.
Invalid HTTP_HOST header: '10.41.95.85:8080'. You may need to add '10.41.95.85' to ALLOWED_HOSTS.
Bad Request: /
[18/Feb/2019 07:47:51] "GET / HTTP/1.1" 400 60826
Invalid HTTP_HOST header: '10.41.95.85:8080'. You may need to add '10.41.95.85' to ALLOWED_HOSTS.
Bad Request: /favicon.ico
[18/Feb/2019 07:47:54] "GET /favicon.ico HTTP/1.1" 400 60906


solution :

django setting.py

ALLOWED_HOSTS = ['*'] -> ALLOWED_HOSTS = ['*']


manage.py语法错误

SyntaxError: invalid syntax
[root@localhost TrackManagement]# python manage.py runserver 0.0.0.0:8080File "manage.py", line 14) from exc


solution
没有运行虚拟环境 外面的环境是python 虚拟环境才是python3 所以会有语法错误

转载于:https://www.cnblogs.com/JanSN/p/10445991.html

virtualvenv+django+uWSGI+nginx 部署 踩坑记录相关推荐

  1. django+uwsgi+nginx部署

    最近线上部署运维工单系统,使用django+uwsgi+nginx部署,发现这篇文章,很详细,觉得不错,转载一下: 写了那么长时间的django,一直没跟nginx结合一下,访问的时候老是得加端口号, ...

  2. Centos django+uwsgi+nginx部署

    Centos django+uwsgi+nginx部署 安装Python CentOS 7 Linux发行版默认包含Python 2.但是,Python 2将于2020年1月1日停产.尽管一些遗留应用 ...

  3. 【django云服务器部署】django+uwsgi+nginx 部署的完整流程

    本篇博客完整地记录了我从购买服务器到完成部署的全过程,需要的朋友可以参考一下我的流程,看这一篇文章就能成功部署项目啦. 写这个的本意是为备忘( 保姆级步骤),同时由于我在最开始部署项目时,没有找到一个 ...

  4. Ubuntu下Django+uWSGI+nginx部署

    本文采用uwsgi+nginx来部署django 这种方式是将nginx作为服务端前端,将接受web所有的请求,统一管理,Nginx把所有的静态请求自己处理,然后把所有非静态请求通过uwsgi传递给D ...

  5. 记一次 leo-api-auto 部署踩坑记录

    首先感谢 leo-api-auto作者无私奉献,贴一段leo-api-auto的简介 LEO API测试平台简介 「LEO API测试平台」是一个免费开源的接口自动化测试平台. 既支持单个接口测试,也 ...

  6. 曹二众 / jeewms仓储管理系统本地部署踩坑记录

    链接地址:https://gitee.com/erzhongxmu/jeewms 码云上找到的gvp项目,仓储管理系统. 在本地idea部署时,遇到了如下的bug,特此记录下! 1.导入servlet ...

  7. build vue 指定版本_vue buid及部署踩坑记录

    build 在vue项目build有两个需求:动态指定环境变量配置(dev.test.production环境打包时对应特定的环境变量配置) 减少项目build后的体积和加快项目build速度 动态指 ...

  8. django+uwsgi+nginx部署访问出现问题(无法解决寻求帮助)

    字体文件已经进行压缩

  9. [转]Docker部署Django由浅入深系列(下): 八步部署Django+Uwsgi+Nginx+MySQL+Redis

    在上篇教程中,我们手动构建了两个容器,一个容器放Django + Uwsgi,另一个容器放Nginx,成功部署了一个简单的Django项目.然而在实际的生产环境中,我们往往需要定义数量庞大的 dock ...

最新文章

  1. 剑指offer:面试题39. 数组中出现次数超过一半的数字
  2. 1小时学会:最简单的iOS直播推流(八)h264/aac 软编码
  3. 深入理解 C# 协变和逆变【转】
  4. asp.net cookie操作-添加cookie,添加键值,移除cookie,移除键值
  5. /etc/security/limits.conf的相关说明
  6. android融云监听消息,关于android:融云-IMkit-拦截或监听所有发送消息
  7. SAP License:sap培训
  8. 程序员们如何破局 5G?
  9. 【Data guard】Failover切换
  10. Windows10搭建PHP7开发环境
  11. iOS 5与iOS 6的 low-memory 处理
  12. SpringBoot中如何优雅的使用拦截器
  13. c++播放音频( c++ play audio),为C++应用程序添加启动音效
  14. android加载本地图片
  15. 基于.net实现F4一键杀死指定进程(龙之谷秒掉器)
  16. Python将Word转换为Pdf格式文件(包含批量转换)
  17. 289714-02-9,Biotin-PEG3-alcohol,Biotin-PEG3-OH含有一个生物素基团和一个与多种官能团反应的末端伯羟基
  18. 中南大学计算机2020研究生分数线,中南大学2020年考研复试分数线已公布
  19. 工厂方法模式练习:工厂方法模式在农场系统中的实现(IDEA)
  20. css 三角角标样式

热门文章

  1. Go Embed简明教程
  2. python列表中 [ :: ]的用法
  3. 详解基于 Cortex-M3 的任务调度(下)
  4. 开发板的I/O在哪里——韦东山嵌入式Linux视频学习笔记01
  5. VMware网络设置详解 打造超级虚拟网络 (说的最为复杂和全面的)
  6. FFmpeg再学习 -- 视音频基础知识
  7. 第八章《对象引用、可变性和垃圾回收》(上)
  8. java 线程状态 jstack_jstack查看jvm线程状态
  9. 汇编语言EQU伪指令
  10. BCOS系统合约介绍