main.py
686 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
from flask_cors import CORS
from flask_babel import Babel
from flask_jwt_extended import JWTManager
#from k2.k2inst import *
from flask import Flask
from k2.k2cfg import k2
# configure flask app
app = Flask(__name__)
app.config['SECRET_KEY'] = k2.secret_key
#app.config.from_object(k2)
# init db
k2().init_db(app)
CORS(app)
jwt = JWTManager(app)
#translate
k2.load_babel_translation_directories()
app.config['BABEL_TRANSLATION_DIRECTORIES'] = k2.babel_translation_directories
babel = Babel(app)
babel.init_app(app, locale_selector=k2.get_locale)
#menu
k2.get_menu_elenents()
# flask routing
from routes import *
if __name__ == '__main__':
app.run(debug=True, port=5000)