Blog / Python

Using ipdb with Docker Compose for interactive debugging

May 30, 2015

Back in the early days of Docker Compose, when it was still called Fig, you couldn't use ipdb with it to do interactive debugging because the container's service ports weren't exposed when using the run command. This has been fixed by including a ---service-ports option to the docker-compose run command.

Below is a sample usage for one of my Django projects, EZ Price Alerts.

In my detail view, I added import ipdb; ipdb.set_trace() …

Using Docker and Docker Compose for local Django development (replacing virtualenv)

April 30, 2015

Before Docker came along, virtualenv was pretty much the tool of choice for Python developers as it allows you to separate package dependencies for different applications you're working on without having to create separate virtual machines for each one. It worked very well for me.

However, there are still some annoying things the developers will have to deal with. Such things include having to install additional applications and services required by the project such as …

EZ Price Alerts: A Django app for tracking Amazon prices

December 28, 2014

EZ Price Alerts

A friend and I started working on this project a few weeks ago as we were talking about the holidays and how useful it would be to build an app to track prices of products on Amazon.com. We know Amazon is very competitive with their pricing and their prices for certain products could change many times a day to match competitors'. Having an app to send you alerts when a product reaches your desired price …

Migrating a Django app from MySQL to PostgreSQL

November 6, 2014

We just finished migrating the database for our Django 1.6 app from MySQL to PostgreSQL. If you have a clean environment this process is as simple as running syncdb and/or migrate to create the tables, truncating the data in those tables, and running the dumpdata and loaddata management commands.

Here are the steps to do this:

Step 1: Create an empty database in your PostgreSQL instance

CREATE DATABASE dbname OWNER rolename;

Step 2: Create a …