app.py 415 B

1234567891011
  1. import sys, os
  2. from flask import Flask
  3. def create_app() -> Flask:
  4. if getattr(sys, 'frozen', False):
  5. template_folder = os.path.join(sys._MEIPASS, "client")
  6. else:
  7. template_folder = "../client"
  8. app = Flask(__name__, template_folder=template_folder, static_folder=f"{template_folder}/static")
  9. app.config["TEMPLATES_AUTO_RELOAD"] = True # Enable auto reload in debug mode
  10. return app