def get_default_user():
 superusers = get_user_model().objects.filter(is_superuser=True).order_by('id')
 if (superusers.count() > 0):
  return superusers[0]
 else:
  raise GeoNodeException('You must have an admin account configured before importing data. Try: django-admin.py createsuperuser')

def get_default_user ( ) : superusers = get_user_model ( ) . objects . filter ( is_superuser = True ) . order_by ( 'id' ) if ( superusers . count ( ) > 0 ) : return superusers [ 0 ] else : raise GeoNodeException ( 'You must have an admin account configured before importing data. Try: django-admin.py createsuperuser' )
create a default user .