Python Flask / Gunicorn / Nginx newbie here.
I followed this tutorial describing how to serve Flask Applications with Gunicorn and Nginx on Ubuntu 18.04.
Everything works and is up and running, no problem. However, my challenge is now that I would like to deploy an updated myproject.py
file containing new code edits to the server. My question is do I simply just need to copy-paste the updated myproject.py
file into the myproject
folder such that it overwrites the old myproject.py
file, and then the server will pick up these changes automatically? Or is there any specific commands I need to run for the changes to take effect or anything else I need to modify? What is the process for adding updated code?
2
Answers
You need to restart the gunicorn service that you created in
/etc/systemd/system/myproject.service
And you can use these: