1 from flask import Flask
2 from flask import render_template
3 from flask import request
4 from flask import abort, redirect, url_for
6 from flask import send_from_directory
8 from logging import Formatter
10 from flask.ext.babel import gettext as _
11 from flask.ext.babel import Babel
13 from config import LANGUAGES
21 return request.accept_languages.best_match(LANGUAGES.keys())
28 return render_template(get_locale() + "/index.html")
30 @app.route("/competition")
32 return render_template(get_locale() + "/competition.html", act="competition")
36 return render_template(get_locale() + "/task.html", act="task")
38 @app.route("/submission")
40 return render_template(get_locale() + "/submission.html", act="submission")
42 @app.route("/coursematerial")
44 return render_template(get_locale() + "/coursematerial.html", act="coursematerial")
46 @app.route("/imprint")
48 return render_template(get_locale () + "/imprint.html", act="imprint")
50 @app.route("/privacy")
52 return render_template(get_locale() + "/privacy.html", act="privacy")
55 @app.errorhandler(404)
56 def page_not_found(e):
57 return render_template(get_locale() + "/404.html")
59 if __name__ == "__main__":
60 app.run(host='localhost', port=5014, debug=True)