code: def _locate_settings(settings=''):
      "Return the path to the DJANGO_SETTINGS_MODULE"
  
      import imp
      import sys
      sys.path.append(os.getcwd())
      settings = settings or os.getenv('DJANGO_SETTINGS_MODULE')
      if settings:
          parts = settings.split('.')
          f = imp.find_module(parts[0])[1]
          args = [f] + parts[1:]
          path = os.path.join(*args)
          path = path + '.py'
          if os.path.exists(path):
              return patf _locate_settings(settings=''):
      "Return the path to the DJANGO_SETTINGS_MODULE"
  
      import imp
      import sys
      sys.path.append(os.getcwd())
      settings = settings or os.getenv('DJANGO_SETTINGS_MODULE')
      if settings:
          parts = settings.split('.')
          f = imp.find_module(parts[0])[1]
          args = [f] + parts[1:]
          path = os.path.join(*args)
          path = path + '.py'
          if os.path.exists(path):
              return path
docs: Return the path to the DJANGO_SETTINGS_MODULE