mardi 12 juillet 2016

sqlalchemy object is not callable in Flask


I am trying to simply add a database for use in web development with Flask but I keep getting the same error. I am using Pycharm.

from flask import Flask
from flask_sqlalchemy import sqlalchemy
app = Flask(__name__)

db = sqlalchemy(app) #This is where problem is


@app.route('/')
def index():
    return "Hello"

if __name__ == '__main__':
    app.run(debug=True)

When I run it it says that "TypeError: 'module' object is not callable".

Would be great if someone could tell me what's wrong. Thanks.


Aucun commentaire:

Enregistrer un commentaire