A sample Flask and SQLAlchemy application to deploy to Cloud Foundry which works out of the box.
- Install Python
- Install Setuptools and pip (see guide above)
- Install Virtualenv (acconplish this by running
pip install virtualenv
) - Run
virtualenv venv
- Run
source venv/bin/activate
on Mac OS X/Linux orvenv\Scripts\activate.bat
on windows - Run
pip install -r requirements.txt
- Run
source env.sh
- Run
python app.py
- Visit http://localhost:5000
- Install the cf CLI
- Create database service instance (in this example using VMWare Tanzu MySQL Broker), run
cf create-service p.mysql db-small database
and wait for the service instance to be deployed (cf services
orcf service database
) - Run
cf push
- Visit the given URL