title: Flask SQLAlchemy db.create_all() not creating database
body: <p>I can't seem to figure out why my call to db.create_all() is not working. </p>
  
  <p>I have an app package with following init:</p>
  
  <pre><code>from flask import Flask
  from config import config
  from flask.ext.sqlalchemy import SQLAlchemy
  
  # create the database object
  db = SQLAlchemy()
  
  # this function is the application factory
  def create_app(environment):
      app = Flask(__name__)
      app.config.from_object(config[environment])
  
      db.init_app(app)
  
      from bp_root import bp_root
      from bp_aws import bp_aws
  
      app.register_blueprint(bp_root, url_prefix='/')
      app.register_blueprint(bp_aws, url_prefix='/aws')
  
      return app
  </code></pre>
  
  <p>Then I have models.py inside the app package:</p>
  
  <pre><code>from datetime import datetime
  from . import db
  
  class MyTestClass(db.Model):
      __tablename__ = 'mytesttable'
      id = db.Column(db.Integer, primary_key=True)
      email = db.Column(db.String(64), nullable=False, unique=True, index=True)
      username = db.Column(db.String(64), nullable=False, unique=True, index=True)
      is_admin = db.Column(db.Boolean)
      password_hash = db.Column(db.String(128))
      location = db.Column(db.String(64))
      member_since = db.Column(db.DateTime, default=datetime.utcnow)
      bio = db.Column(db.Text())
  
      def __init__(self, email, username):
          self.email = email
          self.username = username
  
      def __repr__(self):
          return '&lt;User %r&gt;' % self.username
  </code></pre>
  
  <p>app.config contains, among other things, the following:</p>
  
  <pre><code>'SQLALCHEMY_DATABASE_URL': 'sqlite:////Users/xxxxx/projects/yyyyy/data-dev.sqlite'
  </code></pre>
  
  <p>Then if I fire up my interactive shell, you can see objects exist appropriately and call to db.create_all() appears to work, but results in no database creation:</p>
  
  <pre><code>$ ./manage.py shell
  &gt;&gt;&gt; from app import db
  &gt;&gt;&gt; from app import models
  &gt;&gt;&gt; app
  &lt;Flask 'app'&gt;
  &gt;&gt;&gt; db
  &lt;SQLAlchemy engine='sqlite://'&gt;
  &gt;&gt;&gt; models
  &lt;module 'app.models' from '/Users/xxxxx/projects/yyyyy/app/models.py'&gt;
  &gt;&gt;&gt; dir(models)
  ['MyTestClass', '__builtins__', '__doc__', '__file__', '__name__', '__package__', 'datetime', 'db']
  &gt;&gt;&gt; db.create_all()
  &gt;&gt;&gt; 
  </code></pre>
  
  <p>Any thoughts on why the database isn't getting created?</p>