You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
644 B

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. from flask import Flask, g, request, session, redirect, url_for, render_template
  2. from flask_bootstrap import Bootstrap
  3. import yaml
  4. app = Flask(__name__)
  5. Bootstrap(app)
  6. app.secret_key = 'asdf'
  7. app.debug = True
  8. with open('config.yaml') as f:
  9. yaml_data = yaml.load(f, Loader=yaml.SafeLoader)
  10. search = yaml_data['search']
  11. account_url = yaml_data['accounts']['account_url']
  12. apps = []
  13. for itm in yaml_data['apps'].items():
  14. apps.append(itm[1])
  15. @app.route('/')
  16. def index():
  17. return render_template('index.j2', apps = apps, search = search, account_url = account_url)
  18. if __name__ == '__main__':
  19. app.run(extra_files="config.yaml")