I have two files app.py and mod_login.py
app.py
from flask import Flask
from mod_login import mod_login
app = Flask(__name
This can also happen if you've been working on your scripts and functions and have been moving them around (i.e. changed the location of the definition) which could have accidentally created a looping reference.
You may find that the situation is solved if you just reset the iPython kernal to clear any old assignments:
%reset
or menu->restart terminal