Skip to content

Instantly share code, notes, and snippets.

@ilovejs
Last active August 29, 2015 14:11
Show Gist options
  • Save ilovejs/5b522a29c769bebc3004 to your computer and use it in GitHub Desktop.
Save ilovejs/5b522a29c769bebc3004 to your computer and use it in GitHub Desktop.
Heroku Guide

Heroku Guide


Create

git push heroku master

Procfile

Use a Procfile, a text file in the root directory of your application, to explicitly declare what command should be executed to start your app.

e.g. web: gunicorn gettingstarted.wsgi --log-file -

the name web is important here. It declares that this process type will be attached to the HTTP routing stack of Heroku, and receive web traffic when deployed.

Define a process clock

clock: python clock.py
heroku ps:scale clock=1

Remote Python Interpreter

heroku run python manage.py shell

Heroku logs

heroku logs

Remote bash

heroku run bash

Run the app locally

foreman start web

Open the website as follows:

$ heroku open

Useful Library

  • Django dj-database-url dj-static django-toolbelt gunicorn psycopg2 static3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment