To get any half-decent Python web framework running on Dreamhost, there are a few housekeeping chores you need to do. Of note, I needed to originally do these changes months ago. Dreamhost is constantly updating, making some of my changes unnecessary, or making this route the less efficient way to do them.
Before I get to any of that, though, I should mention that the first thing to do is to enable Passenger from your Dreamhost CPanel. Without that, the method I’ve suggested below won’t work at all!
To do this, just go to your domain’s CPanel option and enable Passenger and Save.
The most important part about getting Flask setup on Dreamhost is the passenger_wsgi.py file. It’s a really small file that tells Passenger where to look for your Flask app and what to do with it. The [DH_WORKING_DIR] needs to be modified in your specific situation. There are some ways to make the passenger_wsgi.py file a bit more generic, and use environment variables a bit more wisely to figure some of these things out itself, but I thought it would be nice to be verbose in this file – so everyone can see exactly what I’m doing.
This is largely the same file for Django as well, except there are 2-3 more lines of Django-specific code that need to be written. For more detailed post, visit this link: http://www.sureshjoshi.com/development/python-web-framework-on-dreamhost/