__init__.py 648 B

123456789101112131415161718192021222324252627282930
  1. """
  2. Sesivacka
  3. web ui for merging pdfs
  4. """
  5. from flask import Flask
  6. # from flask_debugtoolbar import DebugToolbarExtension
  7. try:
  8. import config
  9. except ImportError as e:
  10. print('Could not import config file, defaulting to empty.')
  11. config = None
  12. def create_app(config):
  13. """
  14. Create new app object and cofingure it with *config_object*.
  15. """
  16. app = Flask(__name__)
  17. app.config.from_object(config)
  18. app.app_context().push()
  19. app.debug = True
  20. return app
  21. app = create_app(config)
  22. # toolbar = DebugToolbarExtension(app)
  23. from sesivacka.dashboard import dashboard_blueprint
  24. app.register_blueprint(dashboard_blueprint)