mirror of
https://github.com/django/django.git
synced 2025-07-24 13:44:32 +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:
parent
eb42d8d5d9
commit
cb7bbf97a7
10 changed files with 63 additions and 20 deletions
|
@ -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.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue