DEV Community


Discussion on: Deploy Flask The Easy Way With Gunicorn and Nginx!

brandonwallace profile image
brandon_wallace Author • Edited

It looks like you have a syntax error in the myproject.service file. It appears that you are missing an equal sign somewhere. Check this file /etc/systemd/system/myproject.service for syntax errors.

bjarmstr profile image

Yes! Application deployed. Thanks for the quick answer, it gave me reassurance that my problem had to be something simple. To start with I didn't realize that the unix statement was a continuation of the ExecStart line, not a new line. I fixed this early-on but didn't restart the service after I did the daemon-reload so my mistake remained!
After a successful launch, I rebooted the computer and Gunicorn didn't start. I added Environment="PATH=/var/www/myproject/.venv/bin" to myproject.service and that seems to have solved problem.
Thanks for writing this step-by-step article.

Thread Thread
brandonwallace profile image
brandon_wallace Author

Unfortunately, this line in the myproject.service file wrapped due to the formatting.

ExecStart=/var/www/myproject/.venv/bin/gunicorn --workers 3 --bind unix:/var/www/myproject/myproject.sock wsgi:app
Enter fullscreen mode Exit fullscreen mode

Thanks for letting people know about the Environment="PATH=...." issue. I did not need that variable.

Forem Open with the Forem app