📙
Oreoweb Docs
  • OreoWeb
  • How to guides
  • Dicussions
  • Examples
Powered by GitBook
On this page
  • Heroku deployment
  • Setting things up
  • #Deploying via the Heroku CLI

Was this helpful?

How to guides

Welcome to the How-to guides section of the Oreoweb documentation.How-to guides are like recipes: they guide you through the steps of solving key problems, such as implementing custom behavior.

Heroku deployment

In this guide, we will be looking at how to deploy a oreoweb application to Heroku. You can find the example code in the heroku-example repo

Setting things up

Oreoweb application

Let's assume you have the following app.py script:

from oreoweb import Oreoweb

app = Oreoweb()


@app.route("/")
def home(req, resp):
    resp.text = "Hello, this is Oreo from Heroku"


Procfile

As described in Deployment, the following should fit most use cases:

web: gunicorn -w 4 -k  app:app

requirements.txt

oreoweb
gunicorn

runtime.txt

python-3.6.8
heroku login
  1. Create the application on Heroku, e.g.:

heroku create my-oreoweb-app
  1. Add the app's git remote:

heroku git:remote -a my-oreoweb-app
  1. Commit the changes, if any:

git add .
git commit -m “Ready to deploy to Heroku”
  1. Deploy!

git push heroku master

Once this is done, you can visit the newly deployed application using $ heroku open.

Congrats! You've just deployed a Oreoweb application to Heroku. 🚀

PreviousOreoWebNextDicussions

Last updated 4 years ago

Was this helpful?

The is a text file located in the root directory of your project which explicitly declares what command should be executed to start your app.

Heroku recognizes a Python app by the existence of requirements.txt file in the root directory (see ). Here's an example of what yours may look like:

Place this file in the root directory with a specific Python version. to determine which Python version to use.

Deploying via the Heroku CLI

Log into the (you may need to install it on your machine):

Procfile
Python Dependencies via Pip
Heroku will look at it
#
Heroku CLI