Django& gunicorn给出错误:ImportError没有名为'vp.wsgi'的模块

时间:2017-04-22 19:48:09

标签: python django nginx gunicorn digital-ocean

当我尝试检查gunicorn的状态时,我收到以下错误:

 gunicorn.service - gunicorn daemon
   Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2017-04-22 19:23:39 UTC; 10min ago
 Main PID: 7295 (code=exited, status=3)

Apr 22 19:23:39 vp-first gunicorn[7295]:     return util.import_app(self.app_uri)
Apr 22 19:23:39 vp-first gunicorn[7295]:   File "/home/tony/vp/vpenv/lib/python3.5/site-packages/guni
Apr 22 19:23:39 vp-first gunicorn[7295]:     __import__(module)
Apr 22 19:23:39 vp-first gunicorn[7295]: ImportError: No module named 'vp.wsgi'
Apr 22 19:23:39 vp-first gunicorn[7295]: [2017-04-22 19:23:39 +0000] [7300] [INFO] Worker exiting (pi
Apr 22 19:23:39 vp-first gunicorn[7295]: [2017-04-22 19:23:39 +0000] [7295] [INFO] Shutting down: Mas
Apr 22 19:23:39 vp-first gunicorn[7295]: [2017-04-22 19:23:39 +0000] [7295] [INFO] Reason: Worker fai
Apr 22 19:23:39 vp-first systemd[1]: gunicorn.service: Main process exited, code=exited, status=3/NOT
Apr 22 19:23:39 vp-first systemd[1]: gunicorn.service: Unit entered failed state.
Apr 22 19:23:39 vp-first systemd[1]: gunicorn.service: Failed with result 'exit-code'.

它表示ImportError:没有名为'vp.wsgi'的模块

当我编辑gunicorn配置文件时,其中包含以下内容:

[Unit]
Description=gunicorn daemon
After=network.target

[Service]
User=tony
Group=www-data
WorkingDirectory=/home/tony/vp/vp
ExecStart=/home/tony/vp/vpenv/bin/gunicorn --workers 3 --bind unix:/home/tony/vp/vp/vp.sock vp.wsgi:$

[Install]
WantedBy=multi-user.target

我必须注意我的wsgi.py文件位于:

~/vp/vp/vp/vp/wsgi.py

我的virtualenv位于:

~/vp/vpenv

我的设置位于:

~/vp/vp/vp/config/settings/production.py

我想我的道路有问题,但我尝试过很多东西而且没有用。有什么建议吗?

提前谢谢!

P.S。我找不到任何.sock文件

0 个答案:

没有答案