diff options
author | Lars Wirzenius <liw@liw.fi> | 2018-07-13 15:06:58 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2018-07-13 15:20:43 +0300 |
commit | da30b04924a2748e059a4fbc98eb6e6d0d0177f4 (patch) | |
tree | 9da7a25863979c8f5554b98e464f96c4643b4aee | |
parent | 8b52743f0a1a6942166fe8e4583a1c67b10b3d79 (diff) | |
download | qvisqve-da30b04924a2748e059a4fbc98eb6e6d0d0177f4.tar.gz |
Change: put login page template into .py
We'll want to move it to a file but it's not immediately obvious to me
how, so let's do that later.
-rw-r--r-- | qvisqve/login_router.py | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/qvisqve/login_router.py b/qvisqve/login_router.py index 275f175..ef460b4 100644 --- a/qvisqve/login_router.py +++ b/qvisqve/login_router.py @@ -20,6 +20,28 @@ import bottle import qvisqve +login_template = '''\ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <meta name="description" content="Qvisqve Login"> + <meta name="author" content="Qvarnlabs Ltd"> + <title>Qvisqve Login</title> + </head> + <body> + <form action="/auth" method="POST"> + User name: <input name="username" type="text" /> + <br /> + Password: <input name="password" type="password" /> + <br /> + <input type="submit" value="Login" /> + </form> + </body> +</html> +''' + + class LoginRouter(qvisqve.Router): def get_routes(self): @@ -36,4 +58,5 @@ class LoginRouter(qvisqve.Router): headers = { 'Content-Type': 'text/html; charset=utf-8', } - return qvisqve.ok_response(bottle.template('login'), headers=headers) + template = bottle.template(login_template) + return qvisqve.ok_response(template, headers=headers) |