|
|
|
@ -0,0 +1,24 @@ |
|
|
|
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) |