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

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:8080
File "manage.py", line 14
) from exc


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

virtualvenv+django+uWSGI+nginx 部署 踩坑记录的更多相关文章

  1. virtualvenv+django+uWSGI+nginx 部署

    原创博文 转载请注明出处! 1. virtualvenv 2. django 3. uWSGI 4. nginx 5. 踩坑记录 1. virtualvenv virtualvenv install ...

  2. django+uwsgi+nginx部署(非常详细)

    django+uwsgi+nginx部署 1.介绍: 在网上看了很多教程,但自己部署了很久都没有成功,这篇博文记录自己所踩过得坑. 2.环境: Ubuntu 16.04.1 LTS (GNU/Linu ...

  3. Linux 集群概念 , wsgi , Nginx负载均衡实验 , 部署CRM(Django+uwsgi+nginx), 部署学城项目(vue+uwsgi+nginx)

    Linux 集群概念 , wsgi , Nginx负载均衡实验 , 部署CRM(Django+uwsgi+nginx), 部署学城项目(vue+uwsgi+nginx) 一丶集群和Nginx反向代理 ...

  4. Django+uWSGI+Nginx 部署网站

    Django 1.11设置 保证Django在本地调试没有问题: 当然这是前提^_^ 收集静态文件至指定文件夹 Django静态文件设置具体参考:https://docs.djangoproject. ...

  5. Ubuntu下Django+uWSGI+nginx部署

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

  6. Django+Uwsgi+Nginx部署

    一 uwsgi介绍 uWSGI是一个Web服务器,它实现了WSGI协议,uwsgi, http等协议. Nginx中HttpUwsgiMoule的作用是与uWSGI服务器进行交换 1 WSGI是一种W ...

  7. Mac系统STF自动化环境搭建及部署踩坑记录

    因为公司需要寻找一个免root的自动化测试方案,所以以前做的老方案需要被替代.一阵搜寻找到了这个框架,但是部署起来很是折腾,搞了一下午终于搞定,顺便记录一下过程,有需要的自取. 转载请注明出处:htt ...

  8. Exceptionless 本地部署踩坑记录

    仅已此文记录 Exceptionless 本地部署所遇到的问题 1.安装ElasticSearch文本 执行elasticsearch目录中的elasticsearch.bat 没有执行成功. 使用命 ...

  9. django+uwsgi+nginx 部署生产环境

    一.Uwsgi安装 python3 -m pip install uwsgi cp /usr/local/python3/bin/uwsgi /usr/bin/ 测试 在django项目主目录下cre ...

随机推荐

  1. 洛谷P3750 [六省联考2017]分手是祝愿(期望dp)

    传送门 嗯……概率期望这东西太神了…… 先考虑一下最佳方案,肯定是从大到小亮的就灭(这个仔细想一想应该就能发现) 那么直接一遍枚举就能$O(nlogn)$把这个东西给搞出来 然后考虑期望dp,设$f[ ...

  2. 程序员收藏必看系列:深度解析MySOL优化(一)

    说起MySQL的查询优化,相信大家收藏了一堆奇技淫巧:不能使用SELECT *.不使用NULL字段.合理创建索引.为字段选择合适的数据类型….. 你是否真的理解这些优化技巧?是否理解其背后的工作原理? ...

  3. 深入V8引擎-Time模块介绍

    积跬步,行千里,先从最简单的开始写. 这一篇介绍V8中的时间模块,与libuv粗糙的update_loop_time方法不同,V8有一套独立完整的类负责管理时间. 该类位于src/base/platf ...

  4. Centos 6.x 安装 Redis

    本文以Centos6.8为例子,来进行演示. 1:下载最新版的Redis,比如我们安装在根目录下的redis文件下中 tar zxvf http://download.redis.io/release ...

  5. MySQL数据库(4)

    子查询,MYSQL创建用户和授权,可视化工具N啊vicat的使用,pymysql模块的使用

  6. Struts2 拦截器(Interceptor )原理和配置

    http://blog.csdn.net/kingmax54212008/article/details/51777851

  7. NET Core 2.1 Preview 1

    NET Core 2.1 Preview 1 [翻译] .NET Core 2.1 Preview 1 发布 原文: Announcing .NET Core 2.1 Preview 1 今天,我们宣 ...

  8. Swagger 2.0 集成配置

    传统的API文档编写存在以下几个痛点: 对API文档进行更新的时候,需要通知前端开发人员,导致文档更新交流不及时: API接口返回信息不明确 大公司中肯定会有专门文档服务器对接口文档进行更新. 缺乏在 ...

  9. IIS访问网站出错[要求输入用户名密码]的解决方案

    症状: 1.HTTP 500 - 内部服务器错误 2.您不具备使用所提供的凭据查看该目录或页的权限 3.基于所提供的凭据,您没有权限查看此目录或网页.HTTP 错误 401.3 - 访问被资源 ACL ...

  10. cas实现单点登录原理

    1.基于Cookie的单点登录的回顾        基于Cookie的单点登录核心原理: 将用户名密码加密之后存于Cookie中,之后访问网站时在过滤器(filter)中校验用户权限,如果没有权限则从 ...