Error : Circula import

27 views
Skip to first unread message

Ruzindana Kent

unread,
Mar 3, 2022, 3:05:35 PM3/3/22
to Django users
Hello everyone,

I'm new to django and also new in the group, I wanted to know how to solve circula import errors. here is a screenshot of the error from the terminal.

Any reply about that will be helpful, thank you

Kasper Laudrup

unread,
Mar 3, 2022, 3:26:21 PM3/3/22
to django...@googlegroups.com
Remember that Django is a Python framework, so circular imports are
mostly a Python thing not specific to Django:

https://www.pythonpool.com/python-circular-import/

Kind regards,

Kasper Laudrup
OpenPGP_0xE5D9CAC64AAA55EB.asc
OpenPGP_signature

Jet Ezra

unread,
Mar 4, 2022, 2:00:55 AM3/4/22
to django...@googlegroups.com
But the link tells you the details and how to solve the problem.
Anyway, I think you forgot to share the said screenshots. I can't find them.

Also, when you are asking please, don't try to direct us how we should solve this problem. Just detail your problem and wait for your answer.

Simple.
A circular import happens when you have fileA that has something say a class A, then another file B with also a class B
Then class A imports class B from file B which is also importing class A from B.
So the program keeps importing and never completes the cycle.

Solution,
If you have to use the two like that, then put them in the same file. It is always my shortcut.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e259dd34-1578-7540-35c7-132550a1955c%40stacktrace.dk.


--
jet

Kasper Laudrup

unread,
Mar 4, 2022, 8:19:06 AM3/4/22
to django...@googlegroups.com
On 04/03/2022 07.58, Jet Ezra wrote:
> But the link tells you the details and how to solve the problem.
> Anyway, I think you forgot to share the said screenshots. I can't find them.
>
> Also, when you are asking please, don't try to direct us how we should
> solve this problem. Just detail your problem and wait for your answer.
>

I think you're a bit confused. I answered the original question with the
link, so you answered the wrong person.

Not sure if GMail doesn't support threads or what else might be the
cause of the confusion.

Anyway, no worries. Just wanted to point it out.

Kind regards,

Kasper Laudrup
OpenPGP_0xE5D9CAC64AAA55EB.asc
OpenPGP_signature
Reply all
Reply to author
Forward
0 new messages