One of the common things we do across projects is paginate querysets and lists. Django happens to provide a base Paginator for us, but it’s usefulness is limited. It requires you to do the same repetitive tasks over and over. We’re one of those groups of people who believe that not every URL need’s to [...]
One issue we had come up over at iBegin lately, is the fact that GZipMiddleware tries to encode ALL responses (with a few minor exceptions). In our cases, we sometimes stream actual binary files over the response. Doing this with the standard middleware causes a unicode error as it’s trying to encode all of the [...]
Most of our projects lately are now using JSON data storage in the database. This makes it very efficient for storing additional data without having to run alters are gigantic data sets. It also allows us to store different data for different kinds of sets within the same table. Doing this in Django we originally [...]
For a while now I’ve been wanting to rewrite Lifestream into a contained OO pattern. It seems to be the “best practice” when it comes to WordPress, but tutorials and what are not spread out so it took a bit of time. During the process, I also took the opportunity to speed up certain areas, [...]
This is mostly a note to myself, but also since my blog is very helpful to fellow Google-users I figured I’d throw it up here publicly. Today I needed to update a package on PyPi using setuptools: python setup.py sdist register upload The problem was, no matter what I did, I always seemed to get [...]
A while back I posted a quick, and very simplistic guide to setting up django-sphinx within your project. Since that time we’ve gained a lot of use of the platform. It came to my attention today that the django-nyc group was going to do a presentation on how to setup sphinx within your Django project. [...]
One of the many things we do to help optimize our website load times is optimize the frontend by setting far-futures headers. This simply means that media has an Expires tag of sometime in the distant future (maybe a year), and when we make changes, the filename needs to change. The easiest way to do [...]
So today I went ahead and cleaned up my UUIDField implementation. Originally it was just based off of a snippet. I wanted to swap it over to use a BINARY column in MySQL, after reading on how FriendFeed had been using UUIDs. Due to using Django however, you can’t use binary data or BLOB columns [...]
One of the repetitive tasks that I always seem to have, is handling large amounts of data in chunks. That is, typically I loop through every row in the database, but the result set is too large, or too slow to take into memory all at once. After reading my code a few too many [...]
In the Lifestream service I’ve been working on, I presented myself with the need to have some class abstraction, but not in the fashion which is available in Django models. I wanted to achieve a base class, which is stored in the database, and then child classes which simply override some methods. It turned out [...]