This is Part 4 in a series of blog posts describing my move of ipythonblogs.org from Rackspace to Heroku. In this post I’ll describe the updates I’ve made to the application layer of ipythonblocks.org. Other posts are:
- Part 1: Introduction and Architecture
- Part 2: Data Migration
- Part 3: Database Interface Updates
- Part 4: Application Updates
The application logic is not really changed in this update, the bulk of changes are to support providing SQLAlchemy sessions to allow database access during requests. (See Part 3 for discussion of the database interface layer of ipythonblocks.org.)
Application Overview
ipythonblocks.org is powered by Tornado, which combines an application framework, web server, and asynchronous features. On Heroku the application is started with the command
python -m app.app --port=$PORT --db_url=$DATABASE_URL
$PORT
and $DATABASE_URL
are environment variables provided by Heroku to specify, respectively, which port to listen on and where to find the Postgres database attached to the app. These are parsed from the command line by Tornado’s options module and made available globally on the tornado.options.options
variable. Continue reading “ipythonblocks.org Move: Part 4 – Application Updates”