Browse Source

Fix registration and log in field

https
jakobsn 6 years ago
parent
commit
65a0e11271
3 changed files with 11 additions and 4 deletions
  1. +1
    -0
      src/app/requirements.txt
  2. +7
    -4
      src/app/templates/guestbook.html
  3. +3
    -0
      src/app/views.py

+ 1
- 0
src/app/requirements.txt View File

@@ -1,2 +1,3 @@
web.py==0.40
mysql-connector==2.2.9
flask

+ 7
- 4
src/app/templates/guestbook.html View File

@@ -1,4 +1,4 @@
$def with (entries, guesbook_form)
$def with (entries, guestbook_form)

<head>
<title>Friends</title>
@@ -11,14 +11,17 @@ $def with (entries, guesbook_form)
<h1>Guestbook</h1>
<ul>
$for entry in entries:
<li id="entry[0]">$entry[1]</li>
<p id="$entry[0]">$entry[1]</p>

</ul>



$if session.username:
<h2>Write an entry</h2>
<form method="POST">
$:guesbook_form.render()
</form>
$:guestbook_form.render()
</form>

<br>
<a href="/">Home</a>

+ 3
- 0
src/app/views.py View File

@@ -74,6 +74,9 @@ class guestbook:

def POST(self):
data = web.input()
entry = web.data()
print(data)
print(entry)
model.set_guestbook_entry(data.entry)
return web.seeother("/guestbook")



Loading…
Cancel
Save