peter@1: from flask import Flask peter@1: from flask import render_template peter@1: from flask import request peter@1: from flask import abort, redirect, url_for peter@1: import os peter@1: from flask import send_from_directory peter@1: import logging peter@1: from logging import Formatter peter@1: peter@1: from flask.ext.babel import gettext peter@1: from flask.ext.babel import Babel peter@1: peter@1: app = Flask(__name__) peter@1: babel = Babel(app) peter@1: peter@1: @babel.localeselector peter@1: def get_locale(): peter@1: return "en" #request.accept_languages.best_match(LANGUAGES.keys()) peter@1: peter@1: @app.route("/") peter@1: peter@1: @app.route("/index") peter@1: def index(): peter@3: return render_template("index.html") peter@1: peter@1: @app.route("/competition") peter@1: def competition(): peter@1: return render_template("competition.html", act="competition") peter@1: peter@1: @app.route("/task") peter@1: def task(): peter@1: return render_template("task.html", act="task") peter@1: peter@1: @app.route("/submission") peter@1: def submission(): peter@1: return render_template("submission.html", act="submission") peter@1: peter@1: @app.route("/coursematerial") peter@1: def coursematerial(): peter@1: return render_template("coursematerial.html", act="coursematerial") peter@1: peter@88: @app.route("/imprint") peter@88: def imprint(): peter@88: return render_template("imprint.html", act="imprint") peter@88: peter@90: @app.route("/privacy") peter@88: def privacy(): peter@88: return render_template("privacy.html", act="privacy") peter@88: peter@88: peter@1: @app.errorhandler(404) peter@1: def page_not_found(e): peter@1: return render_template("404.html"), 404 peter@1: peter@1: if __name__ == "__main__": peter@1: app.run(host='localhost', port=5014, debug=True) peter@1: peter@1: