from flask import Flask,render_template,url_for
from flask_sqlalchemy import sqlalchemy
from datetime import datetime
app=Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI']='sqlite:///test.db'
db=sqlalchemy(app)
class Todo(db.Model):
id=db.Column(db.Interger,primary_key=True)
content =db.Column(db.String(200),nullable=False)
completed=db.Column(db.Integer,default=0)
data_created=db.Column(db.DataTime,default=datetime.utcnow)
def __repr__(self):
return '<Task %r>' % self.id
@app.route('/')
def index():
return render_template('index.html')
if __name__=="__main__":
app.run(debug=True)
I am getting this error :
Traceback (most recent call last):
File "stdin", line 1, in module
File "D:\My Programs\Flask_intro\app.py", line 7, in
db=sqlalchemy(app)
TypeError: 'module' object is not callable