ImportError: cannot import name
The problem is that you have a circular import: in app.py in mod_login.py This is not permitted in Python. See Circular import dependency in Python for more info. In short, the solution are either gather everything in one big file delay one of the import using local import