Friday, February 22, 2013

First Dive into Heroku

Heroku is a web-application hosting platform with lots of fun, sexy features and a competitive pricing schedule, and which, unlike Google's App Engine, I had never tried.

Well and good, except it was a struggle at first for me and many of my classmates, probably because it is more flexible than AppEngine (it supports more languages, packages, databases; it supports Django, for example), and therefore requires a bit more configuration. 

It would be a waste of time to try and be as thorough as Jordan Takayama's blog post on the assignment, "Lessons Learned From Deploying Django on Heroku."  In lieu of rewriting something that's more or less perfect as it is, I will comment and provide perspective on his article and the assignment we both completed.  Jordan, if you're reading this: thank you for the help.

One misleading point I found in Jordan's article was on Pip, the dependency manager for Python: "It is important to run pip freeze while the server is still running, otherwise some dependencies will be omitted." I had been struggling with deployment in the following assignment, and thought this might help, but it turned out my problems were with configuring the database rather than package management.  Prof. Johnson must have done things the same way as Jordan.  When I froze while the server was still running, the deployment would fail.  This page was helpful with that issue.  What worked was freezing without the server running, in which case the app deployed and ran on Heroku without errors or complaints.

The database config continues to be a bit confusing.  My local PostgreSQL install is griping that it "could not connect to server: No such file or directory / Is the server running locally and accepting / connections on Unix domain socket "/tmp/.s.PGSQL.5432".  Consulting the Mac Postgres docs and various googlings haven't helped, but I have a feeling I'll fix this with a little more effort...  It worked the first time.  I don't know what broke.

Minutiae Rules Everything Around Me: MREAM. In the interest of sparing you, dear reader, the pain of walking you through tons of other complicated minutiae—configuring path variables was another set of gotchas—I'll simply link to the app that I deployed, which shows that the efforts were not in vein: http://immense-stream-5139.herokuapp.com/.  Hallelujah!



No comments:

Post a Comment