MCPcopy
hub / github.com/django/django / get_user_model

Function get_user_model

django/contrib/auth/__init__.py:268–282  ·  view source on GitHub ↗

Return the User model that is active in this project.

()

Source from the content-addressed store, hash-verified

266
267
268def get_user_model():
269 """
270 Return the User model that is active in this project.
271 """
272 try:
273 return django_apps.get_model(settings.AUTH_USER_MODEL, require_ready=False)
274 except ValueError:
275 raise ImproperlyConfigured(
276 "AUTH_USER_MODEL must be of the form 'app_label.model_name'"
277 )
278 except LookupError:
279 raise ImproperlyConfigured(
280 "AUTH_USER_MODEL refers to model '%s' that has not been installed"
281 % settings.AUTH_USER_MODEL
282 )
283
284
285def get_user(request):

Callers 15

forms.pyFile · 0.90
views.pyFile · 0.90
backends.pyFile · 0.90
__init__Method · 0.90
changepassword.pyFile · 0.90
display_for_fieldFunction · 0.90
user_model_swappedFunction · 0.90
test_get_user_modelMethod · 0.90
test_swappable_userMethod · 0.90

Calls 2

get_modelMethod · 0.45