Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
695 views
in Technique[技术] by (71.8m points)

python - gunicorn: error: unrecognized arguments: myproject.wsgi:application

I am trying to deploy my django project. I am trying to use gunicorn and Nginx. While following this tutorial. I reached at setting up the gunicorn.service file at location /etc/systemd/system/gunicorn.service

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

[Service]
User=tk-lpt-0098
Group=www-data
WorkingDirectory=/home/tk-lpt-0098/Desktop/myproject/myproject
ExecStart=/usr/bin/gunicorn /usr/share/man/man1/gunicorn.1.gz  --workers 3 --bind unix:/etc/systemd/system/myproject.sock myproject.wsgi:application


[Install]
WantedBy=multi-user.target

Proceeding further, I then run the following two commands

sudo systemctl start gunicorn
sudo systemctl enable gunicorn

Now by checking the status of the server using command sudo systemctl status gunicorn I am experiencing the following error

gunicorn.service - gunicorn daemon
     Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Thu 2021-01-21 19:20:03 PKT; 38s ago
   Main PID: 967938 (code=exited, status=2)

????? 21 19:20:03 noc-HP-ProBook-650-G1 systemd[1]: Started gunicorn daemon.
????? 21 19:20:03 noc-HP-ProBook-650-G1 gunicorn[967938]: usage: gunicorn [OPTIONS] [APP_MODULE]
????? 21 19:20:03 noc-HP-ProBook-650-G1 gunicorn[967938]: gunicorn: error: unrecognized arguments: myproject.wsgi
????? 21 19:20:03 noc-HP-ProBook-650-G1 systemd[1]: gunicorn.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
????? 21 19:20:03 noc-HP-ProBook-650-G1 systemd[1]: gunicorn.service: Failed with result 'exit-code'.

I am using ubuntu version Ubuntu 20.04.1 LTS I have tried changing working directory but did not work. I would really appreciate if anyone can help me out with this issue.

question from:https://stackoverflow.com/questions/65829523/gunicorn-error-unrecognized-arguments-myproject-wsgiapplication

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...