Tyring to set up modelview with Flask-Admin causes ImportError

Your code has the line from app.models import User in __init__.py. The problem is that app.models has from . import db. This is a circular import: __init__ tries to import User, which tries to import db, which isn’t defined until after __init__ tries to import User. To solve this, move your local app imports below … Read more