-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
39 lines (32 loc) · 982 Bytes
/
app.py
File metadata and controls
39 lines (32 loc) · 982 Bytes
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
33
34
35
36
37
38
39
import os
import sqlite3
import dash
import dash_bootstrap_components as dbc
from flask_login import UserMixin, current_user
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import create_engine
from app import *
from models import Sector, Users
estilos = [
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css",
dbc.themes.MINTY,
]
dbc_css = (
"https://cdn.jsdelivr.net/gh/AnnMarieW/dash-bootstrap-templates@V1.0.4/dbc.min.css"
)
conn = sqlite3.connect("./src/database/database.db")
engine = create_engine("sqlite:///src/database/database.db")
db = SQLAlchemy()
app = dash.Dash(
__name__,
external_stylesheets=estilos + [dbc_css],
)
server = app.server
app.config.suppress_callback_exceptions = True
app.title = "Simplicity MES App"
server.config.update(
SECRET_KEY=os.urandom(12),
SQLALCHEMY_DATABASE_URI="sqlite:///src/database/database.db",
SQLALCHEMY_TRACK_MODIFICATIONS=False,
)
db.init_app(server)