view.py 551 B

1234567891011121314151617181920
  1. from flask import Flask
  2. import configure
  3. from . import home
  4. class HEnglishFlask(Flask):
  5. def __init__(self, import_name, **kwargs):
  6. super().__init__(import_name, **kwargs)
  7. self.update_config()
  8. @self.context_processor
  9. def inject_base():
  10. return {"title": self.config["TITLE"],
  11. "about": self.config["ABOUT"]}
  12. self.register_blueprint(home.home, url_prefix="/")
  13. def update_config(self):
  14. self.config.update(configure.conf)
  15. self.logger.info("Update config")