Django17

Minor changes to fix deprecation warnings in Django 1.7.