title: AttributeError: __enter__
body: <p>I defined a table in python using sqlalchemy but when i try to create it this error appears</p>
  
  <pre><code>import os
  
  from flask import Flask, render_template, request
  from models import *
  
  app = Flask(__name__)
  app.config["SQLALCHEMY_DATABASE_URI"] = os.getenv("DATABASE_URL")
  app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
  db.init_app(app)
  
  def main():
      db.create_all()
  
  if __name__ == "__main__":
      with app.app_context().push:
          main()
  </code></pre>
  
  <p>Error :</p>
  
  <blockquote>
    <p>Traceback (most recent call last): file "create.py", line 15, in
     with app.app_context().push(): AttributeError: __ enter __</p>
  </blockquote>