Should I activate my Python virtual environment before running my app in upstart? Should I activate my Python virtual environment before running my app in upstart? flask flask

Should I activate my Python virtual environment before running my app in upstart?


You should activate a virtualenv on the production server the same way as you do on the development machine. It allows you to run multiple Python applications on the same machine in a controlled environment. No need to worry that an update of packages in one virtualenv will cause an issue in the other one.

If I may suggest something. I really enjoy using virtualenvwrapper to simplify the use of virtualenvs even more. It allows you to define hooks, e.g.: preactivate, postactivate, predeactivate and postdeactivate using the scripts in $VIRTUAL_ENV/bin/. It's a good place for setting up environmental variables that your Python application can utilize.

And a good and simple tool for process control is supervisord.