You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

24 lines
677 B

from flask import Flask
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///todo.db'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db=SQLAlchemy(app)
class Todo(db.Model):
sno=db.Column(db.Integer,primary_key=True)
title=db.Column(db.String(200),nullable=False)
description = db.Column(db.String(200), nullable=False)
def __repr__(self) :
return "{} is the title and {} is the description".format(self.title,self.description)
app = Flask(__name__)
@app.route("/")
def hello_world():
return "<p>Hello world from flask</p>"
if __name__ == "__main__":
app.run(debug=True)