[Django]-Django Test shows import error but project runs successfully via runserver

3👍

You have a circular import. Your stack trace shows Student depends on Student through a bunch of other modules.

Usually you can solve this by changing your import statement to not have a “from”

Eg import apps.x.y.z

This form of import doesn’t actually execute the imported module when it hits that statement, so it doesn’t get stuck in a circular import loop.

👤Nils

Leave a comment