Heroku Setup for Python and Flask

Getting virtualenv – Setuptools, pip, easyinstall on Ububtu

  • Install python setuptools on Ubuntu
  • Install pip on Ubuntu
  • easy_install on Ubuntu
  • virtualenv on Ubuntu – yes, get used to it.
sudo apt-get install python-setuptools
sudo apt-get install python-pip
  • Install Python development libraries, could be optional but we will use it here.
sudo apt-get install python-dev
  •  Get virtual env
sudo apt-get install python-virtualenv

You might also need a public key from your Ubuntu workstation. If your workstation is secure, you can just hit enter for the passphrase.

ssh-keygen -t rsa

Install the heroku toolbelt.

  • Install Heroku toolbelt on Ubuntu
  • Install Heroku toolbelt on AWS running Ubuntu
wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh

Now your 127.0.0.1 server is in sync with Heroku libraries.

Lets start a project.

mkdir MyHerokuPyProject
mkdir MyHerokuPyProject/source

Now, logout and login in to get heroku in the PATH, or do this;

 sudo su ubuntu

Log into heroku;

heroku login

You need to make heroku aware of the public key;

heroku keys:add

Ok, let’s make sure everything is set so far by starting up virtualenv

Lets use our project directory;

cd MyHerokuPyProject 

 We will add a virtual environment to our Python Heroku project;

virtualenv vedir --distribute
source vedir/bin/activate

Now we can get bottle like this. Notice that I am getting the bottle library, not the bottle.py library. It’s the same thing, but if you try to fetch bottle.py it will fail. Easy_install is a pythoin installation system, so it knows that that which we seek is a .py hootinanny.

pip install Flask

Add the Python image library, which requires the development library;

pip install pil

— or —

sudo apt-get install python-setuptools
sudo apt-get install python-pip
sudo apt-get install python-dev
sudo apt-get install python-virtualenv
ssh-keygen -t rsa
wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh
mkdir MyHerokuPyProject
mkdir MyHerokuPyProject/source

log out and log in


heroku login
heroku keys:add
cd MyHerokuPyProject
virtualenv vedir --distribute
source vedir/bin/activate
pip install Flask
pip install pil

3 thoughts on “Heroku Setup for Python and Flask”

  1. Throughout this grand design of things you actually get an A+ for effort. Where you misplaced everybody ended up being on the particulars. You know, people say, details make or break the argument.. And it could not be much more accurate here. Having said that, permit me inform you what did do the job. Your authoring is definitely incredibly convincing and that is probably why I am taking an effort to opine. I do not make it a regular habit of doing that. Next, despite the fact that I can easily see the jumps in reason you make, I am not necessarily certain of how you appear to connect the ideas that help to make your final result. For now I will, no doubt subscribe to your position however wish in the foreseeable future you link the facts much better.

  2. Together with every thing which seems to be developing within this particular area, a significant percentage of points of view are very refreshing. Even so, I am sorry, but I do not give credence to your entire suggestion, all be it stimulating none the less. It would seem to everyone that your opinions are not entirely validated and in actuality you are your self not really entirely confident of the argument. In any event I did take pleasure in reading it.

  3. Throughout this great scheme of things you will get a B- just for hard work. Exactly where you misplaced us ended up being on the specifics. As they say, the devil is in the details… And it could not be more correct at this point. Having said that, permit me tell you exactly what did deliver the results. The writing is actually rather convincing and this is most likely why I am making an effort in order to comment. I do not make it a regular habit of doing that. Second, even though I can see a leaps in logic you come up with, I am not necessarily sure of exactly how you appear to connect the points which in turn produce the actual final result. For the moment I will, no doubt yield to your issue however trust in the near future you connect your facts better.

  4. Auto Like, Status Liker, autolike, Facebook Auto Liker, Autoliker Facebook, Autoliker, Facebook Liker, auto liker, facebook auto liker, Autoliker, Photo Liker, Status Auto Liker, Fb Autoliker, Auto Liker, Increase Facebook Likes, Photo Auto Liker, Facebook Autoliker, Working Auto Liker, auto like, autoliker

  5. Wow that was strange. I just wrote an very long comment but after I clicked submit my comment did not appear. Grrrr… well I am not writing all that over again. Anyway, just wanted to say excellent blog!|

  6. Howdy! This is my first visit to your blog! We are a team of volunteers and starting a new initiative in a community in the same niche. Your blog provided us beneficial information to work on. You have done a marvellous job!|

  7. hello!,I like your writing very so much! proportion we keep in touch more about your post on AOL? I need an expert on this space to unravel my problem. May be that is you! Having a look ahead to peer you. |

  8. It is truly very difficult in this busy life to listen news on TV, so I just use web for that purpose, and obtain the most up-to-date news.|

  9. Great beat ! I would like to apprentice while you amend your web site, how can i subscribe for a blog site? The account helped me a applicable deal. I had been a little bit familiar of this your broadcast provided bright clear concept|

  10. Oh my goodness! Amazing article dude! Thank you so much, However I am experiencing troubles with your RSS. I do not understand why I cannot join it. Is there anyone else having identical RSS issues? Anyone who knows the answer will you kindly respond? Thanks!!|

  11. Undeniably believe that which you stated. Your favorite justification appeared to be on the web the easiest thing to be aware of. I say to you, I definitely get annoyed while people consider worries that they plainly do not know about. You managed to hit the nail upon the top as well as defined out the whole thing without having side effect , people could take a signal. Will likely be back to get more. Thanks|

Leave a Reply

Your email address will not be published. Required fields are marked *