Update views.py to be compliant with Django 1.7