|
@@ -1,8 +1,9 @@
|
|
-from flask import Flask
|
|
|
|
|
|
+from flask import Flask,render_template
|
|
import sentry_sdk
|
|
import sentry_sdk
|
|
from sentry_sdk.integrations.flask import FlaskIntegration
|
|
from sentry_sdk.integrations.flask import FlaskIntegration
|
|
from apscheduler_elab import Config
|
|
from apscheduler_elab import Config
|
|
from flask_apscheduler import APScheduler
|
|
from flask_apscheduler import APScheduler
|
|
|
|
+from flask_bootstrap import Bootstrap
|
|
import importlib
|
|
import importlib
|
|
import os
|
|
import os
|
|
from file_util import FileUtil
|
|
from file_util import FileUtil
|
|
@@ -15,7 +16,7 @@ sentry_sdk.init(
|
|
|
|
|
|
def create_app():
|
|
def create_app():
|
|
app_instance = Flask(__name__)
|
|
app_instance = Flask(__name__)
|
|
- app.config.from_object(Config())
|
|
|
|
|
|
+ app_instance.config.from_object(Config())
|
|
blueprint_list = []
|
|
blueprint_list = []
|
|
path = os.path.dirname(os.path.abspath(__file__)) + r'/blue'
|
|
path = os.path.dirname(os.path.abspath(__file__)) + r'/blue'
|
|
file_list = FileUtil.load_file(path)
|
|
file_list = FileUtil.load_file(path)
|
|
@@ -26,11 +27,17 @@ def create_app():
|
|
for blueprint in blueprint_list:
|
|
for blueprint in blueprint_list:
|
|
auto_blueprint_module = importlib.import_module('blue.' + str(blueprint))
|
|
auto_blueprint_module = importlib.import_module('blue.' + str(blueprint))
|
|
auto_blueprint = auto_blueprint_module.__dict__[blueprint]
|
|
auto_blueprint = auto_blueprint_module.__dict__[blueprint]
|
|
- app.register_blueprint(auto_blueprint, url_prefix='/' + str(blueprint))
|
|
|
|
|
|
+ app_instance.register_blueprint(auto_blueprint, url_prefix='/' + str(blueprint))
|
|
return app_instance
|
|
return app_instance
|
|
|
|
|
|
|
|
|
|
app = create_app()
|
|
app = create_app()
|
|
|
|
+bt = Bootstrap(app)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+@app.route('/')
|
|
|
|
+def index():
|
|
|
|
+ return render_template('login-page.html')
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
if __name__ == '__main__':
|
|
@@ -38,6 +45,6 @@ if __name__ == '__main__':
|
|
scheduler.init_app(app)
|
|
scheduler.init_app(app)
|
|
scheduler.start()
|
|
scheduler.start()
|
|
app.run(
|
|
app.run(
|
|
- host='0.0.0.0',
|
|
|
|
|
|
+ host='127.0.0.1',
|
|
port=5001
|
|
port=5001
|
|
)
|
|
)
|