Fix runtests on Django 1.7

Django 1.7 [requires `django.setup()`](https://docs.djangoproject.com/en/dev/releases/1.7/#standalone-scripts) when using Django in standalone scripts. This function does not exist in previous versions of Django, hence the try-except block.