Reputation: 137
I deployed my Django application to the internet and every time after changing codes, I have to run this command to make changes happen:
sudo systemctl restart gunicorn
Is there any way to run this command through codes (for example in views)? or schedule it? Or is there any way to force Gunicorn restarts after changing in codes?
I have tried Subprocess but I couldn't make it work.
Upvotes: 0
Views: 968
Reputation: 1304
You could use fabric script to restart gunicorn. Check this link Automate Deployment With Fabric Python
Upvotes: 1