您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

33 行
650B

  1. from flask import Blueprint,render_template
  2. from modules.core.core import cbpi
  3. react = Blueprint('ui', __name__, template_folder='templates', static_folder='static')
  4. @cbpi.addon.core.initializer(order=10)
  5. def init(cbpi):
  6. cbpi._app.register_blueprint(react, url_prefix='/ui')
  7. @react.route('/', methods=["GET"])
  8. def index():
  9. #return react.send_static_file("index.html")
  10. js_files = []
  11. for key, value in cbpi.cache["js"].iteritems():
  12. js_files.append(value)
  13. return render_template('index.html', js_files=js_files)
  14. @cbpi._app.errorhandler(404)
  15. def page_not_found(e):
  16. return render_template('404.html'), 404