mirror of
https://github.com/django/django.git
synced 2024-11-29 14:46:18 +01:00
Fixed #22932: Documented circular dependency issues with swappable user
This commit is contained in:
parent
db9a1a0c47
commit
e9249bc20b
@ -399,6 +399,14 @@ use as your User model.
|
||||
is created in the first migration of its app (usually called ``0001_initial``);
|
||||
otherwise, you will have dependency issues.
|
||||
|
||||
In addition, you may run into a CircularDependencyError when running your
|
||||
migrations as Django won't be able to automatically break the dependency
|
||||
loop due to the dynamic dependency. If you see this error, you should
|
||||
break the loop by moving the models depended on by your User model
|
||||
into a second migration (you can try making two normal models that
|
||||
have a ForeignKey to each other and seeing how ``makemigrations`` resolves that
|
||||
circular dependency if you want to see how it's usually done)
|
||||
|
||||
|
||||
Referencing the User model
|
||||
--------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user