pymove3d.py
author stetrabby <info@trabucchi.de>
Sat, 18 Jan 2014 10:22:25 +0100
changeset 102 d1524a27c8be
parent 97 9fa249552dba
child 100 fbc07ac77baa
permissions -rwxr-xr-x
footer classes fixed
     1 from flask import Flask
     2 from flask import render_template
     3 from flask import request
     4 from flask import abort, redirect, url_for
     5 import os
     6 from flask import send_from_directory
     7 import logging
     8 from logging import Formatter
     9 
    10 from flask.ext.babel import gettext as _
    11 from flask.ext.babel import Babel
    12 
    13 from config import LANGUAGES
    14 
    15 
    16 app = Flask(__name__)
    17 babel = Babel(app)
    18 
    19 @babel.localeselector
    20 def get_locale():
    21     return request.accept_languages.best_match(LANGUAGES.keys())
    22 
    23 @app.route("/")
    24 
    25 @app.route(_("/index"))
    26 def index():
    27     return render_template(_("en/index.html"))
    28 
    29 @app.route(_("/competition"))
    30 def competition():
    31     return render_template(_("en/competition.html"), act="competition")
    32 
    33 @app.route(_("/task"))
    34 def task():
    35     return render_template(_("en/task.html"), act="task")
    36 
    37 @app.route(_("/submission"))
    38 def submission():
    39     return render_template(_("en/submission.html"), act="submission")
    40 
    41 @app.route(_("/coursematerial"))
    42 def coursematerial():
    43     return render_template(_("en/coursematerial.html"), act="coursematerial")
    44 
    45 @app.route(_("/imprint"))
    46 def imprint():
    47     return render_template(_("en/imprint.html"), act="imprint")
    48 
    49 @app.route(_("/privacy"))
    50 def privacy():
    51     return render_template(_("en/privacy.html"), act="privacy")
    52 
    53 
    54 @app.errorhandler(404)
    55 def page_not_found(e):
    56     return render_template(_("en/404.html")), 404
    57 
    58 if __name__ == "__main__":
    59     app.run(host='localhost', port=5014, debug=True)
    60 
    61 
Impressum Datenschutzerklärung