title: "ImportError: cannot import name" using flask_sqlalchemy
body: <p>I'm working on creating a minimal application as <a href="http://flask-sqlalchemy.pocoo.org/2.3/quickstart/#a-minimal-application" rel="nofollow noreferrer">outlined here</a>.</p>
  
  <p>My minimal code is below:</p>
  
  <pre><code>from flask import Flask
  from flask_sqlalchemy import SQLAlchemy
  
  
  app = Flask(__name__)
  
  
  app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////sandbox.db'
  db = SQLAlchemy(app)
  
  
  class User(db.Model):
      id = db.Column(db.Integer, primary_key=True)
      username = db.Column(db.String(80), unique=True, nullable=False)
      email = db.Column(db.String(120), unique=True, nullable=False)
  
      def __repr__(self):
          return '&lt;User %r&gt;' % self.username
  
  
  if __name__ == '__main__':
      app.run(debug = True)
  </code></pre>
  
  <p>The issue I'm running into is when I try to import the db object from an interactive Python shell.</p>
  
  <pre><code>&gt;&gt;&gt; from my_app import db
  </code></pre>
  
  <p>I systematically get this error message returned</p>
  
  <pre><code>Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  ImportError: cannot import name db
  </code></pre>
  
  <p>Here is some context:</p>
  
  <p>My folder is called sandbox, here are the files and their structure within it</p>
  
  <pre><code>.
  ├── __init__.py
  ├── alembic
  │   ├── README
  │   ├── env.py
  │   ├── env.pyc
  │   ├── script.py.mako
  │   └── versions
  ├── alembic.ini
  ├── hue.py
  ├── my_app.py
  ├── my_app.pyc
  ├── random_stuff.py
  ├── sqlalchemy.py
  ├── sqlalchemy.pyc
  └── templates
      └── index.html
  </code></pre>
  
  <p>I can't find out what I'm doing wrong, I must be missing something very obvious.</p>