pymove3d.py
author Reimar Bauer <rb.proj AT googlemail DOT com>
Sat, 18 Jan 2014 10:36:44 +0100
changeset 103 31d8ca3c9cca
parent 100 fbc07ac77baa
child 109 bd4b675d9214
permissions -rwxr-xr-x
merged main
     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 
    24 @app.route("/")
    25 
    26 @app.route("/index")
    27 def index():
    28     return render_template(get_locale() + "/index.html")
    29 
    30 @app.route("/competition")
    31 def competition():
    32     return render_template(get_locale() + "/competition.html", act="competition")
    33 
    34 @app.route("/task")
    35 def task():
    36     return render_template(get_locale() + "/task.html", act="task")
    37 
    38 @app.route("/submission")
    39 def submission():
    40     return render_template(get_locale() + "/submission.html", act="submission")
    41 
    42 @app.route("/coursematerial")
    43 def coursematerial():
    44     return render_template(get_locale() + "/coursematerial.html", act="coursematerial")
    45 
    46 @app.route("/imprint")
    47 def imprint():
    48     return render_template(get_locale () + "/imprint.html", act="imprint")
    49 
    50 @app.route("/privacy")
    51 def privacy():
    52     return render_template(get_locale() + "/privacy.html", act="privacy")
    53 
    54 
    55 @app.errorhandler(404)
    56 def page_not_found(e):
    57     return render_template(get_locale() + "/404.html")
    58 
    59 if __name__ == "__main__":
    60     app.run(host='localhost', port=5014, debug=True)
    61 
    62 
Impressum Datenschutzerklärung