MCPcopy
hub / github.com/django/django / acreate_superuser

Method acreate_superuser

django/contrib/auth/models.py:204–215  ·  view source on GitHub ↗
(
        self, username, email=None, password=None, **extra_fields
    )

Source from the content-addressed store, hash-verified

202 create_superuser.alters_data = True
203
204 async def acreate_superuser(
205 self, username, email=None, password=None, **extra_fields
206 ):
207 extra_fields.setdefault("is_staff", True)
208 extra_fields.setdefault("is_superuser", True)
209
210 if extra_fields.get("is_staff") is not True:
211 raise ValueError("Superuser must have is_staff=True.")
212 if extra_fields.get("is_superuser") is not True:
213 raise ValueError("Superuser must have is_superuser=True.")
214
215 return await self._acreate_user(username, email, password, **extra_fields)
216
217 acreate_superuser.alters_data = True
218

Calls 3

_acreate_userMethod · 0.95
setdefaultMethod · 0.45
getMethod · 0.45