title: Create staff user in Django
body: <p>I'm trying to create a staff user in Django with</p>
  
  <pre><code>UserModel.objects.create_user(username="A", email="a@a.com", password="a", is_staff=True)
  </code></pre>
  
  <p>but in UserManager in Django at <a href="https://github.com/django/django/blob/master/django/contrib/auth/models.py" rel="noreferrer">https://github.com/django/django/blob/master/django/contrib/auth/models.py</a> it says</p>
  
  <pre><code>class UserManager(BaseUserManager):
      use_in_migrations = True
  
      def _create_user(self, username, email, password,
                       is_staff, is_superuser, **extra_fields):
          """
          Creates and saves a User with the given username, email and password.
          """
          if not username:
              raise ValueError('The given username must be set')
          email = self.normalize_email(email)
          user = self.model(username=username, email=email,
                            is_staff=is_staff, is_superuser=is_superuser,
                            **extra_fields)
          user.set_password(password)
          user.save(using=self._db)
          return user
  
      def create_user(self, username, email=None, password=None, **extra_fields):
          return self._create_user(username, email, password, False, False,
                                   **extra_fields)
  
      def create_superuser(self, username, email, password, **extra_fields):
          return self._create_user(username, email, password, True, True,
                                   **extra_fields)
  </code></pre>
  
  <p>so when trying to set <code>is_staff = False</code> it will always override this field with <code>is_staff = True</code> unless I use <code>create_superuser</code> instead of <code>create_user</code>; however, <code>create_superuser</code> also sets <code>is_superuser = True</code>.</p>
  
  <p>Have they forgot to create the method <code>create_staff_user</code> in Django? :-)</p>