Skip to content

Instantly share code, notes, and snippets.

Last active February 11, 2023 19:16
What would you like to do?
Simple Flask application for Cloud Foundry

Simple Python Flask app on Cloud Foundry

This is a (very) simple Flask application that shows how the built-in Python buildpack detection on Cloud Foundry works.

To push to Cloud Foundry, log in and then use

$ cf push myapp-name

Python on Cloud Foundry

Cloud Foundry:

  • Python is a first class language
  • Deploy with cf push myapp
  • Scale with cf scale myapp ...

You can try Cloud Foundry by signing up for a free trial at Pivotal Web Services.

"""Cloud Foundry test"""
from flask import Flask
import os
app = Flask(__name__)
port = int(os.getenv("PORT"))
def hello_world():
return 'Hello World! I am running on port ' + str(port)
if __name__ == '__main__':'', port=port)
web: python
Copy link

cceasy commented Aug 23, 2017

Anybody got troubles? I get "ERR Uploading failed" while doing cf push. (uploading droplets failed)

Copy link

You need to add a proc file to run Flask app on cloud foundry. Please follow this link -

Copy link

eddiewebb commented Dec 30, 2018

Per flasks own docs the built in server is for development, and is not suitable for production. Instead should be handled by one of the methods described

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment