is there is a way to make this code output appear inside html page . This is an admin page linked to a sqlbrowser database . The code is python

Viewed 24

is there is a way to link make this code output appear inside html page . This is an admin page linked to a sqlbrowser database . The code is python

from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_admin import Admin 
from flask_admin.contrib.sqla import ModelView

app = Flask(__name__)
DB_NAME = "database.db"
app.config['SQLALCHEMY_DATABASE_URI'] = f'sqlite:///{DB_NAME}'
app.config['SECRET_KEY'] = 'mysecret'

db = SQLAlchemy(app)

admin = Admin(app)

class  user(db.Model):
    id = db.Column(db.Integer, primary_key= True)
    name = db.Column(db.String(30))
    email = db.Column(db.String(30))
    password = db.Column(db.String(30))
    birthdate = db.Column(db.String(30))

admin.add_view(ModelView(user,db.session))

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