Fix errors related to django1.7

Try the django1.7 method before the old django method