Replace deprecated calls.

I triggered several RemovedInDjango18Warning messages when using Django 1.7. This replaces the deprecated calls with new versions.

Note that this will *not* work with Django 1.4 LTS. 1.6 should be fine but is not tested.