Last active
April 16, 2023 14:28
-
-
Save fprieur/8670905 to your computer and use it in GitHub Desktop.
Auto Reload Gunicorn On File Change Event
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip install watchdog -U | |
# now there is a command called "watchmedo", you'll like it... | |
# in terminal #1, run: | |
gunicorn app:myapp --pid=gunicorn.pid | |
# in terminal #2, run: | |
watchmedo shell-command \ | |
--patterns="*.py;*.html;*.css;*.js" \ | |
--recursive \ | |
--command='echo "${watch_src_path}" && kill -HUP `cat gunicorn.pid`' . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment