Install Flask on webfaction
Add new application in Webfaction
Click the Add an application button, then Create a new application, and in the pop-over form:
Name: my_app (I like to keep the application name the same as the site name, unless I have multiple applications handling one site)
App category: mod_wsgi
App type: mod_wsgi 4.5.2/Python 3.5 (latest versions as of this writing)
Open port: leave unchecked
URL: should be pre-filled with http://example.com/
Once saved, click Save again to finish creating the new website.
Yay! Now visit your domain in your browser and you should see something like this:
Welcome to your mod_wsgi website! It uses:
Python 3.5.1 (default, Jan 23 2016, 01:36:36)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-16)]
WSGI version: (4, 5, 2)
Database if needed
If a database is needed for the site.
Go to Databases > Databases > Add new database
Database type: PostgreSQL
Database owner: Create a new postgresql user, and enter your user and password combo here.
Add-ons: leave all unchecked
Setup a virtualenv using python
First, ssh into your web server and change to the site’s webapp directory:
$ ssh firstname.lastname@example.org
$ cd webapps/my_app
Then, let’s make a virtual environment for the new Flask site to run under. I’m calling mine `my_app.
python3.6 -m venv ~/.virtualenvs/my_app
activate your virtualenvsource
update your pip to make sure it is current
pip install —upgrade pip
pip install Flask