Adds Django 1.5 compatibility

Tiny fix. Breaks Django <1.5