What would be the best way to host multiple flask and django apps on a single server? From reading around it seems to better to use nginx and/or gunicorn, but I can't decide between nginx alone OR nginx + gunicorn. Should I consider Tornado? I don't really plan to have real-time stuff in my apps.<p>I'm using an EC2 micro instance (Ubuntu Precise)
In my experience using nginx + gunicorn will help here is why: gunicorn create child processes for your server. This way you can have 3-4 process all working towards serving your web-application. Nginx helps for serving static files and reverse poxing to either flask / django process. You should also consider using something like supervisord. Supervisord will make sure you're processes are restarted if they crash for some reason.
I have more experience with Nginx + Gunicorn, but I can tell you that it's pretty painless. "manage.py run_gunicorn" to get started, and you can assign it an arbitrary port and number of worker nodes depending on how many users you expect. Supervisor will obviously be needed to keep it up and running, but I've got dev instances that are fairly heavily trafficked I'm not running supervisor with, and I've yet to see Gunicorn crash, where I used to see Flup crash constantly.<p>In addition to what's already been mentioned, you'll definitely want to be using virtualenv for portability. Being able to maintain different libraries for different apps is essential, and virtualenv does a great job of keeping things isolated.