Trouble with class imports in flask application Trouble with class imports in flask application flask flask

Trouble with class imports in flask application


You have a circular import triggered by from queries_Final2 import get_db.

You're doing this, effectively (pseudo-code):

# Inside module Aimport x from module B    -> goes to module B to get x    -> module B begins loading its imports (happens on first import)    -> module B imports y from module A    -> module B fails to import y from module A because module A is still being defined

Over time, you'll learn how to abstract your tools in a manner that will avoid this problem, but in the meantime, you can fix it by simply moving the lines from queries_Final2 import get_db to inside your get and post functions, instead of leaving them at the module level.