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

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 所以会有语法错误

最新文章

  1. GAT2.0使用文档(单接口开发)
  2. 前端复习-02-ajax原生以及jq和跨域方面的应用。
  3. Eclipse中propedit插件安装(解决property中文问题)
  4. aaaa
  5. Debian添加软件源
  6. Linux MySql安装步骤
  7. iOS开发-UI (一)常用控件
  8. FZU 1912 Divisibility by Thirty-six(整除问题+字符串维护+贪心)
  9. JSP中EL表达式取值问题记录(已解决)
  10. python2 => python3 踩坑集合
  11. C#网页提交html代码报错
  12. 带你深入理解STL之Deque容器
  13. IntelliJ IDEA启动Tomcat后,却无法访问Tomcat主页 等一系列问题
  14. 杂谈2.py
  15. 使用RMAN Active duplicate创建异地auxiliary Database
  16. 字符驱动之二操作方法(struct file_operations)【转】
  17. Java反射--基于ParameterizedType实现泛型类,参数化类型
  18. 【WPF】ListBox无法滚动
  19. openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 四
  20. Distinctive Image Features from Scale-Invariant Keypoints(个人翻译+笔记)-介绍

热门文章

  1. MCP|BFY|Proteome Analysis of Human Neutrophil Granulocytes From Patients With Monogenic Disease Using Data-independent Acquisition(单基因疾病患者中性粒细胞的DIA蛋白质组分析)
  2. 如何使用JAR文件重用JMeter代码并节省时间
  3. 牛客假日团队赛2 G.CountyFairEvents
  4. Mysql数据库服务启动
  5. 关系型数据库---MySQL---数据库设计三大范式
  6. Prime Count 求大区间素数个数
  7. docker系列(二):镜像
  8. linq动态分页排序
  9. 基于Java实现的快速排序
  10. css实现瀑布流