Answer the question
In order to leave comments, you need to log in
Cyclic import in Django. How to avoid?
Good afternoon. I'm trying to connect models in Django through a One-to-Many relationship. Three models in different applications. A circular import error occurs. How to avoid this, so as not to transfer models?
Model --> Model --> Model
Answer the question
In order to leave comments, you need to log in
Cyclic imports are always a signal of bad architecture. However, you can get around this by setting the ForeignKey to the model name string instead of the class.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question