Caveat Refactor

July 25, 2013

Refactoring is important enough to be treated as a development activity in its own right and should not be shoe-horned in on the quiet along with other tasks

This post is partly an attempt to atone for my own sins (and apologise to @stevejalim), partly a public aide memoire to prevent me from doing it again.

In 20 years of software . . .

Read More

Custom filters for Django objects

July 16, 2013

Using mixins to add fluid filters to Django model managers.

There are plenty of samples on the web showing how to create custom Django
QuerySet and Manager classes to create fluid manager interfaces; here's
another one.

We have a lot of shared fields across models, that we filter on in similar
ways, irrespective of the model. A good . . .

Read More

Deploying Django apps to Heroku (#3)

July 11, 2013

In the third (probably not final) post on our deployment process, our Fabric
script has become intelligent enough to manage deployment options on our
behalf.

First a quick recap. As I've posted previously, YunoJuno is a Django app,
hosted on Heroku. We use Fabric to manage deployments, which, as is the
Heroku way, start with a git push, . . .

Read More

Testing OAuth APIs

June 14, 2013

Testing code that relies on remote APIs that themselves rely on OAuth can be painful, if not impossible. This is how we do it.

For all of its well-publicised issues, OAuth is a great step-forward for secure authentication / authorisation for granting access to remote APIs on by apps on behalf of users. We use OAuth to access LinkedIn data on . . .

Read More

Deployment changelog

May 20, 2013

We've upgraded our Fabric deployment scripts so that we can now see all of
the commits that will be pushed as part of the deployment.

As we mature as a company and a development team, our use of Fabric to script
basic tasks is also maturing. Our latest addition is to incorporate the git
changelog into the deployment script, so that prior . . .

Read More

Debug Python logging issues

P introspection with logging_tree

April 26, 2013

Have you ever wondered where all your logging information is coming from (or even where it's going to, or possibly why it's all duplicated)? If so, then logging_tree is your saviour.

I came across the logging_tree library recently as I was following a specific issue in the urllib3 library, regarding the proliferation of INFO . . .

Read More

Running rq in sync mode

April 26, 2013

A run of pickling problems with our tests has required us to delve into the rq and django-rq source code. If you run rq in synchronous mode, queued functions are run directly by the enqueue method, but redis is still used to store 'job' information.

We use the redis -> rq -> django-rq chain to run all our async processes, and a . . .

Read More

Archive
  Subscribe by Email and Never Miss a Post