title: ImportError: cannot import name 'db'
body: <p><a href="https://i.stack.imgur.com/ygysD.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ygysD.png" alt="enter image description here"></a></p>
  
  <p>I am working on adding flask admin to a preexisting flask boiler plate project. I've been able to get the basic project working at <a href="https://github.com/kc1/flask-base" rel="noreferrer">https://github.com/kc1/flask-base</a> (SCREENSHOT). I now need to add modelviews to add basic CRUD functionality. To do this I changed the code to :</p>
  
  <pre><code>adm = Admin(app,name='flaskadmin')
  from app.models import User
  adm.add_view(ModelView(User, db.session))
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/N49Jd.png" rel="noreferrer"><img src="https://i.stack.imgur.com/N49Jd.png" alt="enter image description here"></a></p>
  
  <p>You can see that it works. But if I import the User model with the rest of the imports at the top of app/init I get:</p>
  
  <pre><code>Traceback (most recent call last):
    File "...flask-base/manage.py", line 10, in &lt;module&gt;
      from app import create_app, db
    File "E:\ENVS\r3\flask-base\app\__init__.py", line 17, in &lt;module&gt;
      from app.models import User
    File "E:\ENVS\r3\flask-base\app\models\__init__.py", line 6, in &lt;module&gt;
      from .user import *  # noqa
    File "E:\ENVS\r3\flask-base\app\models\user.py", line 7, in &lt;module&gt;
      from .. import db, login_manager
  ImportError: cannot import name 'db'
  </code></pre>
  
  <p>Why?</p>