app.py (847B)
1 from flask import Flask 2 from flask_bcrypt import Bcrypt 3 from flask_login import LoginManager 4 from flask_sqlalchemy import SQLAlchemy 5 from flask_socketio import SocketIO 6 7 domain = 'muizenval.tk' 8 9 app = Flask(__name__) 10 app.config['SECRET_KEY'] = 'iot_project' 11 app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///site.db' 12 app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False 13 db = SQLAlchemy(app) 14 bcrypt = Bcrypt(app) 15 socket = SocketIO(app, logger=True) 16 login_manager = LoginManager(app) 17 login_manager.login_view = 'login' 18 login_manager.login_message_category = 'info' 19 #sslify = SSLify(app) 20 #ssl_files = ('ssl/public.crt', 'ssl/private.key') 21 22 # to run 'routes.py' and make the routes available 23 # '#noqa' is nessesary for my formatter to not put them to the top! 24 from .models import * # noqa 25 from .routes import * # noqa 26 from .socket import * # noqa