简体   繁体   English

设置gunicorn和django:没有名为revamp.wsgi的模块

[英]setting up gunicorn and django: No module named revamp.wsgi

Setting up django on a VM following this article and this is how I've setup gunicorn systemd 建立在虚拟机上的Django下面这个文章,这是怎么了我设置gunicorn systemd

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

[Service]
User=muiruri_samuel
Group=www-data
WorkingDirectory=/home/muiruri_samuel/webapp
ExecStart=/home/muiruri_samuel/webapp/djangoenv/bin/gunicorn --access-logfile - --workers 3 --bind unix:/home/muiruri_samuel/webapp/revamp/revamp.sock revamp.wsgi:application

[Install]
WantedBy=multi-user.target

when I check the status there's an issue with how i created this 当我检查状态时,我如何创建此问题

(djangoenv) muiruri_samuel@pluscolor:~/webapp/revamp/revamp$ sudo systemctl status gunicorn
● gunicorn.service - gunicorn daemon
   Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2018-01-22 10:52:33 UTC; 29min ago
 Main PID: 23354 (code=exited, status=3)
Jan 22 10:52:33 pluscolor gunicorn[23354]:     return util.import_app(self.app_uri)
Jan 22 10:52:33 pluscolor gunicorn[23354]:   File "/home/muiruri_samuel/webapp/djangoenv/local/
Jan 22 10:52:33 pluscolor gunicorn[23354]:     __import__(module)
Jan 22 10:52:33 pluscolor gunicorn[23354]: ImportError: No module named revamp.wsgi
Jan 22 10:52:33 pluscolor gunicorn[23354]: [2018-01-22 10:52:33 +0000] [23379] [INFO] Worker ex
Jan 22 10:52:33 pluscolor gunicorn[23354]: [2018-01-22 10:52:33 +0000] [23354] [INFO] Shutting 
Jan 22 10:52:33 pluscolor gunicorn[23354]: [2018-01-22 10:52:33 +0000] [23354] [INFO] Reason: W
Jan 22 10:52:33 pluscolor systemd[1]: gunicorn.service: Main process exited, code=exited, statu
Jan 22 10:52:33 pluscolor systemd[1]: gunicorn.service: Unit entered failed state.
Jan 22 10:52:33 pluscolor systemd[1]: gunicorn.service: Failed with result 'exit-code'.

that is the wsgi file. 这是wsgi文件。 The wsgi file I do know exist here /home/muiruri_samuel/webapp/revamp/revamp\\wsgi.py 我知道的wsgi文件存在于/home/muiruri_samuel/webapp/revamp/revamp\\wsgi.py

For the normal Django project layout, the WorkingDirectory should be the one that contains manage.py . 对于正常的Django项目布局, WorkingDirectory应该是包含manage.py布局。 It looks like you are using the directory above that at the moment. 看来您目前正在使用上面的目录。 Try changing it to: 尝试将其更改为:

WorkingDirectory=/home/muiruri_samuel/webapp/revamp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM