Use hasattr instead of checking for django version number to check