app.py 689 B

1234567891011121314151617181920212223242526272829303132333435
  1. from flask import Flask, render_template, Response
  2. from blues import com, idc
  3. import logging
  4. def init() -> "Flask":
  5. logging.getLogger("ppocr").setLevel(logging.WARN)
  6. this = Flask(__name__)
  7. this.config["JSON_AS_ASCII"] = False
  8. this.config["TEMPLATES_AUTO_RELOAD"] = True
  9. this.register_blueprint(com)
  10. this.register_blueprint(idc)
  11. return this
  12. app = init()
  13. @app.route("/")
  14. def index():
  15. return render_template("navigate.html")
  16. @app.route("/favicon.ico")
  17. def icon():
  18. with open("static/html/favicon.png", "rb") as f:
  19. img = f.read()
  20. f.close()
  21. return Response(img, mimetype="image/x-png")
  22. if __name__ == "__main__":
  23. app.run()