Simple autoreload for wsgi python apps running in uWSGI
by Konstantinos Koukopoulos
While developing, it’s usefull to have uwsgi autoreload your application. In my case I rsync changed files to the server running uWSGI. But uWSGI only monitors the app configuration file, which generally doesn’t change. In order to have your app auto-reload (like django does) you can switch to your app’s base directory and execute:
while true ; do find . -name \*.py \ # for python -newer /path/app.ini \ # if changed -exec touch /path/app.ini \; \ # reload -print # print sleep 2 done
scp some python file to the server the
-newer predicate will turn true for this file and
touch the configuration file (thereby making it newer than all the source files).