4

I want to know, how to restart my gunicorn server automatically. after my django project code has been changed. currently now i am doing manual restart after i made changes , just kill the process and reload it. but it is not a good way. so i want to know how to do the same automatically after code getting changed . i am using nginx too.

5
  • 1
    Use gunicorn for production only. For development, use Django's server.
    – khajvah
    Jan 18, 2016 at 8:45
  • Use the --reload argument.
    – Klaus D.
    Jan 18, 2016 at 8:54
  • That depends on how you actually run your gunicorn...
    – Sayse
    Jan 18, 2016 at 9:44
  • i am using gunicorn for my production alone. for development i am using local django wsgi only... Jan 21, 2016 at 11:40
  • I am running gunicorn like this , gunicorn_django -b 127.0.0.1:8000 -w3 -p /tmp/gunicorn_appname.pid Jan 21, 2016 at 11:41

1 Answer 1

2

Take a look at the reload setting:

https://docs.gunicorn.org/en/stable/settings.html#debugging

reload

--reload False Restart workers when code changes.

This setting is intended for development. It will cause workers to be restarted whenever application code changes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.