def create_admin_user(username, password):
 u = User()
 u.username = username
 u.email = '{0}@dev.mail.example.com'.format(username)
 u.is_superuser = True
 u.is_staff = True
 u.set_password(password)
 try:
  u.save()
  print('Created user {0} with password {1}.'.format(username, password))
 except Exception as e:
  pass

def create_admin_user ( username , password ) : u = User ( ) u . username = username u . email = '{0}@dev.mail.example.com' . format ( username ) u . is_superuser = True u . is_staff = True u . set_password ( password ) try : u . save ( ) print ( 'Created user {0} with password {1}.' . format ( username , password ) ) except Exception as e : pass
create a user for testing the admin .