def DjangoVersion():
 try:
  __import__(('django.' + _DESIRED_DJANGO_VERSION))
 except ImportError:
  pass
 import django
 try:
  return distutils.version.LooseVersion('.'.join(map(str, django.VERSION)))
 except AttributeError:
  return LooseVersion(django.VERSION)

def DjangoVersion ( ) : try : __import__ ( ( 'django.' + _DESIRED_DJANGO_VERSION ) ) except ImportError : pass import django try : return distutils . version . LooseVersion ( '.' . join ( map ( str , django . VERSION ) ) ) except AttributeError : return LooseVersion ( django . VERSION )
discover the version of django installed .