Fix Django 1.6 support.

Change-Id: Iff101d772caecb7682be2e40739b1e5b0a245b04