This course will become read-only in the near future. Tell us at community.p2pu.org if that is a problem.

Configure Heroku


Connect your project to Heroku so you can publish your first Python website.

In this step we will get you set up with the tools necessary to deploy your web app to Heroku.

Why Heroku?

Heroku is a hosting platform that makes it easy to experiment and prototype. They provide a toolkit that works with what many developers are already using (git) and they provide hosting for small apps free of charge. For experimenting with a new language or framework, it’s often essential to get a prototype up and running quickly without having to worry about deployment, and Heroku provides that ease-of-use.

Getting started

First thing is to sign up for a Heroku account. It’s free and takes less than two minutes.

Next you’ll need to download the Heroku Toolbelt for your platform The package will install the heroku command and make sure it’s in your PATH.

Heroku’ing your project

Open your terminal and cd into the directory you created when you were setting up your project with git. You can do a git status to make sure you are in the right place – if you are not, you will get a message saying: fatal: Not a git repository (or any of the parent directories): .git or something equally off-putting.

Once you are in the correct directory, type into the terminal:

heroku create --stack cedar

This will create a heroku app on the cedar stack and add a remote repository to git. (bonus excerise: research what other stacks there are and why we are using cedar). It will also let you know where you can find you know where you can find your webapp once you’ve complete it.

To complete this exercise, copy the output of running the above command as a comment into the task.

Task Discussion


  • gushan said:

    Creating app... murmuring-stream-57311, stack is cedar-14
    https://murmuring-stream-57311.herokuapp.com/ | https://git.heroku.com/murmuring-stream-57311.git
     

    on May 3, 2016, 10:44 p.m.
  • FrankT said:

    Creating cryptic-taiga-5845... done, stack is cedar
    http://cryptic-taiga-5845.herokuapp.com/ | git@heroku.com:cryptic-taiga-5845.git
    Git remote heroku added

    on April 4, 2014, 5:16 p.m.
  • IF said:

     

    Creating ancient-lowlands-7319... done, stack is cedar
    http://ancient-lowlands-7319.herokuapp.com/ | git@heroku.com:ancient-lowlands-7319.git
    Git remote heroku added
    on Dec. 13, 2013, 11:54 a.m.
  • Fer said:

    fer@debian:~/webpython$ heroku create --stack cedar
    Creating radiant-ravine-2533... done, stack is cedar
    http://radiant-ravine-2533.herokuapp.com/ | git@heroku.com:radiant-ravine-2533.git

     

    on Nov. 14, 2013, 5:42 a.m.
  • joepep said:

     

    Enter your Heroku credentials.
    Email: joepepgh@yahoo.com
    Password (typing will be hidden): 
    Could not find an existing public key.
    Would you like to generate one? [Yn] y
    Generating new SSH public key.
    Uploading SSH public key /home/nana/.ssh/id_rsa.pub... done
    Creating ancient-garden-5408... done, region is us
    http://ancient-garden-5408.herokuapp.com/ | git@heroku.com:ancient-garden-5408.git
    Git remote heroku added
    on June 10, 2013, 9:26 a.m.
  • Wouter van den Bos said:

     

    Enter your Heroku credentials.
    Email: @gmail.com
    Password (typing will be hidden): 
    Found existing public key: /Users/woutervdbos/.ssh/id_rsa.pub
    Uploading SSH public key /Users/woutervdbos/.ssh/id_rsa.pub... done
    Creating afternoon-bayou-8245... done, stack is cedar
    http://afternoon-bayou-8245.herokuapp.com/ | git@heroku.com:afternoon-bayou-8245.git
    Git remote heroku added
     
    alternative stack badious bamboo (less options)
    on Feb. 22, 2013, 4:03 p.m.
  • daviesgo said:

     

    
    
    	Enter your Heroku credentials.
    Email: daviesgo@gmail.com
    Password (typing will be hidden):
    Could not find an existing public key.
    Would you like to generate one? [Yn] Yn
    Generating new SSH public key.
    Uploading SSH public key C:/Users/Gareth/.ssh/id_rsa.pub... done
    Creating guarded-wave-2272... done, stack is cedar
    http://guarded-wave-2272.herokuapp.com/ | git@heroku.com:guarded-wave-2272.git
    Git remote heroku added
    on Sept. 7, 2012, 10:20 a.m.
  • saravanan said:

    Enter your Heroku credentials.
    Email: blackcombmagi45@gmail.com
    Password (typing will be hidden):
    Could not find an existing public key.
    Would you like to generate one? [Yn] y
    Generating new SSH public key.
    Uploading SSH public key /home/magi/.ssh/id_rsa.pub... done
    Creating shrouded-hollows-1986... done, stack is cedar
    http://shrouded-hollows-1986.herokuapp.com/ | git@heroku.com:shrouded-hollows-1986.git
    Git remote heroku added
     

    on Aug. 6, 2012, 2:41 a.m.