pymove3d.py
changeset 1 3aa6f55df039
child 3 c07ffbab8647
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/pymove3d.py	Wed Nov 27 12:40:37 2013 +0100
     1.3 @@ -0,0 +1,49 @@
     1.4 +from flask import Flask
     1.5 +from flask import render_template
     1.6 +from flask import request
     1.7 +from flask import abort, redirect, url_for
     1.8 +import os
     1.9 +from flask import send_from_directory
    1.10 +import logging
    1.11 +from logging import Formatter
    1.12 +
    1.13 +from flask.ext.babel import gettext
    1.14 +from flask.ext.babel import Babel
    1.15 +
    1.16 +app = Flask(__name__)
    1.17 +babel = Babel(app)
    1.18 +
    1.19 +@babel.localeselector
    1.20 +def get_locale():
    1.21 +    return "en" #request.accept_languages.best_match(LANGUAGES.keys())
    1.22 +
    1.23 +@app.route("/")
    1.24 +
    1.25 +@app.route("/index")
    1.26 +def index():
    1.27 +    return render_template("index.html", act="index")
    1.28 +
    1.29 +@app.route("/competition")
    1.30 +def competition():
    1.31 +    return render_template("competition.html", act="competition")
    1.32 +
    1.33 +@app.route("/task")
    1.34 +def task():
    1.35 +    return render_template("task.html", act="task")
    1.36 +
    1.37 +@app.route("/submission")
    1.38 +def submission():
    1.39 +    return render_template("submission.html", act="submission")
    1.40 +
    1.41 +@app.route("/coursematerial")
    1.42 +def coursematerial():
    1.43 +    return render_template("coursematerial.html", act="coursematerial")
    1.44 +
    1.45 +@app.errorhandler(404)
    1.46 +def page_not_found(e):
    1.47 +    return render_template("404.html"), 404
    1.48 +
    1.49 +if __name__ == "__main__":
    1.50 +    app.run(host='localhost', port=5014, debug=True)
    1.51 +
    1.52 +
Impressum Datenschutzerklärung