File size: 755 Bytes
6b83428 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# -*- coding: utf-8 -*-
from flask import Flask, render_template
from flask_admin import Admin
from flask_sqlalchemy import SQLAlchemy
# Consts
SQLPROTOCOL = "mysql://" # "sqlite:////"
SQLUNAME = "root"
SQLPASS = "Sahy1990!"
SQLHOST = "localhost"
SQLDB = "nowcasting"
# App
app = Flask(__name__)
app.config["SECRET_KEY"] = "your-secret-key"
app.config[
"SQLALCHEMY_DATABASE_URI"
] = f"{SQLPROTOCOL}{SQLUNAME}:{SQLPASS}@{SQLHOST}/{SQLDB}"
db = SQLAlchemy(app)
admin = Admin(app, name="My Admin Panel", template_mode="bootstrap4")
@app.route("/")
def home():
return render_template(
"admin.html"
) # "Welcome to Nowcasting App.<br><br>The dashapp is still under development..."
if __name__ == "__main__":
app.run(debug=True)
|