flaschengeist/geruecht/__init__.py

39 lines
1.1 KiB
Python
Raw Normal View History

2019-04-17 12:46:46 +00:00
""" Server-package
Initialize app, cors, database and bcrypt (for passwordhashing) and added it to the application.
Initialize also a singelton for the AccesTokenControler and start the Thread.
"""
2019-04-11 21:56:55 +00:00
from flask import Flask
2019-01-13 19:07:46 +00:00
from flask_sqlalchemy import SQLAlchemy
from flask_bcrypt import Bcrypt
from flask_cors import CORS
2019-04-11 21:56:55 +00:00
from .controller.accesTokenController import AccesTokenController
# from flask_login import LoginManager
2019-01-13 19:07:46 +00:00
app = Flask(__name__)
CORS(app)
2019-04-11 21:56:55 +00:00
# app.config['SECRET_KEY'] = '0a657b97ef546da90b2db91862ad4e29'
2019-01-13 19:07:46 +00:00
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///site.db'
db = SQLAlchemy(app)
bcrypt = Bcrypt(app)
2019-04-11 21:56:55 +00:00
accesTokenController = AccesTokenController()
accesTokenController.start()
2019-04-11 21:56:55 +00:00
# login_manager = LoginManager(app)
# login_manager.login_view = 'login'
# login_manager.login_message_category = 'info'
2019-01-13 19:07:46 +00:00
MONEY = "moneymaster"
GASTRO = "gastro"
USER = "user"
BAR = "bar"
2019-04-11 21:56:55 +00:00
from geruecht import routes
from geruecht.baruser.routes import baruser
from geruecht.finanzer.routes import finanzer
app.register_blueprint(baruser)
app.register_blueprint(finanzer)