RageZBla / cf-flask-sqlalchemy-sample

A sample Flask and SQLAlchemy application to deploy to Cloud Foundry which works out of the box.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CF Sample Flask SQLAlchemy application

A sample Flask and SQLAlchemy application to deploy to Cloud Foundry which works out of the box.

Run locally

  1. Install Python
  2. Install Setuptools and pip (see guide above)
  3. Install Virtualenv (acconplish this by running pip install virtualenv)
  4. Run virtualenv venv
  5. Run source venv/bin/activate on Mac OS X/Linux orvenv\Scripts\activate.bat on windows
  6. Run pip install -r requirements.txt
  7. Run source env.sh
  8. Run python app.py
  9. Visit http://localhost:5000

Deploy on Cloud Foundry

  1. Install the cf CLI
  2. 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 or cf service database)
  3. Run cf push
  4. Visit the given URL

References

About

A sample Flask and SQLAlchemy application to deploy to Cloud Foundry which works out of the box.

License:MIT License


Languages

Language:Python 55.5%Language:HTML 27.5%Language:Shell 17.0%