File: views.py

package info (click to toggle)
python-werkzeug 1.0.1%2Bdfsg1-2%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,888 kB
  • sloc: python: 21,897; javascript: 173; makefile: 36; xml: 16
file content (29 lines) | stat: -rw-r--r-- 678 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from .application import expose
from .application import Response
from .application import TemplateResponse


@expose("index")
def index(req):
    return TemplateResponse("index.html", title="Index")


@expose("about")
def about(req):
    return TemplateResponse("about.html", title="About")


@expose("blog/index")
def blog_index(req):
    return TemplateResponse("blog.html", title="Blog Index", mode="index")


@expose("blog/show")
def blog_show(req, post_id):
    return TemplateResponse(
        "blog.html", title="Blog Post #%d" % post_id, post_id=post_id, mode="show"
    )


def page_not_found(req):
    return Response("<h1>Page Not Found</h1>", mimetype="text/html")