peter@1
|
1 |
from flask import Flask
|
peter@1
|
2 |
from flask import render_template
|
peter@1
|
3 |
from flask import request
|
peter@1
|
4 |
from flask import abort, redirect, url_for
|
peter@1
|
5 |
import os
|
peter@1
|
6 |
from flask import send_from_directory
|
peter@1
|
7 |
import logging
|
peter@1
|
8 |
from logging import Formatter
|
peter@1
|
9 |
|
peter@1
|
10 |
from flask.ext.babel import gettext
|
peter@1
|
11 |
from flask.ext.babel import Babel
|
peter@1
|
12 |
|
peter@1
|
13 |
app = Flask(__name__)
|
pkoppatz@39
|
14 |
#babel = Babel(app)
|
peter@1
|
15 |
|
pkoppatz@39
|
16 |
#@babel.localeselector
|
pkoppatz@39
|
17 |
#def get_locale():
|
pkoppatz@39
|
18 |
# return "en" #request.accept_languages.best_match(LANGUAGES.keys())
|
peter@1
|
19 |
|
peter@1
|
20 |
@app.route("/")
|
peter@1
|
21 |
@app.route("/index")
|
peter@1
|
22 |
def index():
|
peter@3
|
23 |
return render_template("index.html")
|
peter@1
|
24 |
|
peter@1
|
25 |
@app.route("/competition")
|
peter@1
|
26 |
def competition():
|
peter@1
|
27 |
return render_template("competition.html", act="competition")
|
peter@1
|
28 |
|
peter@1
|
29 |
@app.route("/task")
|
peter@1
|
30 |
def task():
|
peter@1
|
31 |
return render_template("task.html", act="task")
|
peter@1
|
32 |
|
peter@1
|
33 |
@app.route("/submission")
|
peter@1
|
34 |
def submission():
|
peter@1
|
35 |
return render_template("submission.html", act="submission")
|
peter@1
|
36 |
|
peter@1
|
37 |
@app.route("/coursematerial")
|
peter@1
|
38 |
def coursematerial():
|
peter@1
|
39 |
return render_template("coursematerial.html", act="coursematerial")
|
peter@1
|
40 |
|
peter@34
|
41 |
@app.route("/impressum")
|
peter@34
|
42 |
def impressum():
|
peter@34
|
43 |
return render_template("impressum.html")
|
peter@34
|
44 |
|
rb@47
|
45 |
@app.route("/datenschutzerklaerung")
|
peter@36
|
46 |
def datenschutz():
|
peter@36
|
47 |
return render_template("datenschutzerklaerung.html")
|
peter@36
|
48 |
|
peter@1
|
49 |
@app.errorhandler(404)
|
peter@1
|
50 |
def page_not_found(e):
|
peter@1
|
51 |
return render_template("404.html"), 404
|
peter@1
|
52 |
|
peter@1
|
53 |
if __name__ == "__main__":
|
pkoppatz@39
|
54 |
app.run(host='localhost', port=5018, debug=False)
|
peter@1
|
55 |
|
peter@1
|
56 |
|