title: Registering sqlalchemy extension with current application using init_app()
body: <p>I'm trying to run an existing app in a new environment. The app ran fine in a previous environment, but when I run it locally it refuses to connect with my DB.</p>
  
  <pre><code>AssertionError: The sqlalchemy extension was not registered to the current application.  Please make sure to call init_app() first.
  </code></pre>
  
  <p>Where I'm confused is that this exact code worked in a previous environment. It's asking me to call init_app() but, from my understanding, that's only if there are multiple apps, which there aren't. </p>
  
  <p>In debugging mode, the app does recognize the object i.e.</p>
  
  <pre><code>&gt;&gt;&gt; type(Candidate)
  &lt;class 'flask_sqlalchemy.model.DefaultMeta'&gt;
  </code></pre>
  
  <p>I am unclear how and where to incorporate app_init() into my code. I have tried...</p>
  
  <pre><code>db = SQLAlchemy(app)
  db.init_app(app) 
  </code></pre>
  
  <p>but this didn't have any impact. </p>
  
  <p>Folder structure...</p>
  
  <pre><code>app
  - static folder
  - templates folder
  - _init_.py
  - config.py
  - views.py
  - run.py
  - Procfile
  </code></pre>