code: def import_from_settings(attr, *args):
      
      try:
          if args:
              return getattr(settings, attr, args[0])
          return getattr(settings, attr)
      except AttributeError:
          raise ImproperlyConfigured('Setting {0} not found'.format(attr))
docs: Load an attribute from the django settings.
  
      :raises:
          ImproperlyConfigured