uwsgi Djangp no model named “项目名”?

  • 回答 (0)
  • 关注 (0)
  • 查看 (80)

os: Linux-3.10.0-693.21.1.el7.x86_64 #1 SMP Wed Mar 7 19:03:37 UTC 2018

nodename: VM_0_5_centos

machine: x86_64

clock source: unix

pcre jit disabled

detected number of CPU cores: 1

current working directory: /root

detected binary path: /root/.pyenv/versions/3.6.0/bin/uwsgi

uWSGI running as root, you can use --uid/--gid/--chroot options

*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***

chdir() to /home/sftp/demo2

*** WARNING: you are running uWSGI without its master process manager ***

your processes number limit is 7283

your memory page size is 4096 bytes

detected max file descriptor number: 100001

lock engine: pthread robust mutexes

thunder lock: disabled (you can enable it with --thunder-lock)

uWSGI http bound on :8001 fd 4

spawned uWSGI http 1 (pid: 27422)

uwsgi socket 0 bound to TCP address 127.0.0.1:37791 (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.0 (default, Mar 23 2019, 00:57:50) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]

PEP 405 virtualenv detected: /home/sftp/venv

Set PythonHome to /home/sftp/venv

*** Python threads support is disabled. You can enable it with --enable-threads ***

Python main interpreter initialized at 0xfe8590

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 'demo2'

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: 27383, cores: 1)

用户3827890用户3827890提问于
用户3827890修改于

本地

macosx python3.6 venv pycharm上传部署

服务器 centos python3.6.6 用uwsgi 设置链接。但是出现

ModuleNotFoundError: No module named 'demo2'

demo2 是我的项目名,这是怎么回事

行吧,自问自答

首先问题是没有模块名叫demo2

下面这行是我的启动代码:

uwsgi --http :8080 --chdir /home/sftp/demo2 --home /home/sftp/venv --module demo2.wsgi --enable-threads

chdir的目录写错了

我项目经过pycharm部署之后是

sftp

|

--demo2

|

--venv

|

--manage.py

当我在cd /sftp下运行

uwsgi --http :8080 --module demo2.wsgi

却成功了,才意识到,

不能加demo2

正确的写法

uwsgi --http :8080 --chdir /home/sftp[到此为止!!!] --home /home/sftp/venv --module demo2.wsgi --enable-threads

关于作者

扫码关注云+社区

领取腾讯云代金券