Advertisement
fduran

Heroku Python

Dec 14th, 2011
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.23 KB | None | 0 0
  1. # www.fduran.com
  2. # Heroku notes for python, fixes http://devcenter.heroku.com/articles/python
  3. # Ubuntu 11.04 (Natty Narwhal)
  4.  
  5. mkdir heroku
  6. cd heroku
  7.  
  8. # Prerequisites
  9. curl -O https://raw.github.com/pypa/virtualenv/master/virtualenv.py
  10. cp virtualenv.py /usr/bin/virtualenv
  11. chmod a+x /usr/bin/virtualenv
  12. # for Flask example: pip install Flask
  13.  
  14. # Local Workstation Setup
  15. # apt-add-repository doesn't work
  16. echo "deb http://toolbelt.herokuapp.com/ubuntu ./" >> /etc/apt/sources.list
  17. curl http://toolbelt.herokuapp.com/apt/release.key | apt-key add -
  18. apt-get update
  19. apt-get install heroku-toolbelt
  20. # note: they say so but that does not install foreman
  21. ln -s /usr/bin/ruby1.8 /usr/bin/ruby
  22.  
  23. heroku login
  24. nano web.py
  25.  
  26.  
  27. # Declare Dependencies with Pip
  28. nano requirements.txt
  29. # note: after first deployment it change magically to wsgiref==0.1.2, back to Flask
  30. pip freeze > requirements.txt
  31. # rest the same
  32.  
  33. # Foreman
  34. apt-get install rubygems
  35. gem install foreman
  36. ln -s /var/lib/gems/1.8/bin/foreman /usr/bin/foreman
  37. # rest the same
  38.  
  39. # pushing changed code
  40. git add . # for new files
  41. git commit -am "balh"
  42. git push heroku master
  43.  
  44. # django
  45. # pre-requisite before pip install Django psycopg2
  46. apt-get install libpq-dev python-dev
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement