简体   繁体   中英

uWSGI runs Django project from command line but not from Emperor uwsgi.service file

I am running a virtualenv with Python3.6 on Ubuntu 16.04 for my Django project using uwsgi and NGINX .

I have uWSGI installed globally and also in the virtualenv.

I can run my project from the command line using uWSGI within the env with

/home/user/Env/myproject/bin/uwsgi --http :8080 --home /home/user/Env/myproject --chdir /home/user/myproject/src/myproject -w myproject.wsgi

and go to my domain and it loads fine.

However I am obviously running uWSGI in "Emperor mode" and when I set the service file up (along with NGINX) the domain displays internal server error .

The uWSGI logs trace to --- no python application found ---

I was having this problem when running

uwsgi --http :8080 --home /home/user/Env/myproject --chdir /home/user/myproject/src/myproject -w myproject.wsgi

because it was using the global install uwsgi instead of the virtualenv one.

I changed my StartExec to the virtualenv uwsgi path but no luck.

I can't figure out what I'm doing wrong, path error? Syntax error?

my /etc/systemd/system/uwsgi.service file

[Unit]
Description=uWSGI Emperor service

[Service]
ExecStartPre=/bin/bash -c 'mkdir -p /run/uwsgi; chown user:www-data /run/uwsgi'
ExecStart=/home/user/Env/myproject/bin/uwsgi --emperor /etc/uwsgi/sites
Restart=always
KillSignal=SIGQUIT
Type=notify
NotifyAccess=all

[Install]
WantedBy=multi-user.target

可以,但似乎我运行了sudo systemctl stop uwsgi ,然后sudo systemctl start uwsgi ,它现在可以工作了。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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