docs: def createuser(ctx, email, password, superuser, no_password, prompt):
      'Create a new user.'
  
      if prompt:
          if not email:
              email = click.prompt('Email')
  
          if not (password or no_password):
              password = click.prompt('Password')
  
          if superuser is None:
              superuser = click.confirm('Should this user be a superuser?', default=False)
  
      if superuser is None:
          superuser = False
  
      if not email:
          raise click.ClickException('Invalid or missing email address.')
  
      if not no_password and not password:
          raise click.ClickException('No password set and --no-password not passed.')
  
      import django
      django.setup()
  
      from bitcaster.models import User
  
      user = User.objects.filter(email=email).first()
  
      if user:
          if prompt:
              change = click.confirm(f'User {email} already exists. Proceed updating it?', default=False)
              if not change:
                  ctx.exit()
              user.set_password(password)
              if superuser:
                  user.is_superuser = superuser
  
              op = 'updated'
          else:
              click.echo('Nothing to do. User exists', err=True, color='red')
              sys.exit(1)
      else:
          op = 'created'
          user = User(
              email=email,
              is_superuser=superuser,
              is_staff=superuser,
              is_active=True,
          )
          if password:
              user.set_password(password)
  
      try:
          user.save()
      except Exception as e:
          raise click.ClickException(e)
  
      click.echo(f'User {email} {op}')