Update base.py to support Django 1.5

This seems to work for a few ad-hoc tests.