A corporation manager and dashboard for EVE Online
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.
 
 
 
 
 

51 lines
1.1 KiB

  1. #! /usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. from pathlib import Path
  4. from flask import Flask, g
  5. from flask_mako import MakoTemplates, render_template
  6. from werkzeug.local import LocalProxy
  7. import calefaction
  8. from calefaction.auth import AuthManager
  9. from calefaction.config import Config
  10. from calefaction.database import Database
  11. from calefaction.eve import EVE
  12. from calefaction.util import catch_errors, set_up_hash_versioning
  13. app = Flask(__name__)
  14. basepath = Path(__file__).resolve().parent
  15. config = Config(basepath / "config")
  16. Database.path = str(basepath / "data" / "db.sqlite3")
  17. eve = EVE()
  18. auth = AuthManager(config, eve)
  19. MakoTemplates(app)
  20. set_up_hash_versioning(app)
  21. config.install(app)
  22. @app.before_request
  23. def prepare_request():
  24. g.auth = auth
  25. g.config = config
  26. g.eve = eve
  27. g.version = calefaction.__version__
  28. app.before_request(Database.pre_hook)
  29. app.teardown_appcontext(Database.post_hook)
  30. @app.route("/")
  31. @catch_errors(app)
  32. def index():
  33. return render_template("landing.mako")
  34. @app.route("/login")
  35. @catch_errors(app)
  36. def login():
  37. return "login" # ...
  38. if __name__ == "__main__":
  39. app.run(debug=True, port=8080)