Skip to content

Instantly share code, notes, and snippets.

@fprieur
Last active April 16, 2023 14:28
Show Gist options
  • Save fprieur/8670905 to your computer and use it in GitHub Desktop.
Save fprieur/8670905 to your computer and use it in GitHub Desktop.
Auto Reload Gunicorn On File Change Event
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