mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #25966 -- Made get_user_model() work at import time.
This makes it equivalent to: `from django.contrib.auth.models import User`. Thanks Aymeric Augustin for the initial patch and Tim Graham for the review.
This commit is contained in:
committed by
Markus Holtermann
parent
eb42d8d5d9
commit
cb7bbf97a7
@@ -473,10 +473,6 @@ Here are some common problems that you may encounter during initialization:
|
||||
will also trigger this exception. The ORM cannot function properly until all
|
||||
models are available.
|
||||
|
||||
Another common culprit is :func:`django.contrib.auth.get_user_model()`. Use
|
||||
the :setting:`AUTH_USER_MODEL` setting to reference the User model at import
|
||||
time.
|
||||
|
||||
This exception also happens if you forget to call :func:`django.setup()` in
|
||||
a standalone Python script.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user