Parcourir la source

Welcome friends

https
jakobsn il y a 6 ans
Parent
révision
7fb4261731
5 fichiers modifiés avec 42 ajouts et 11 suppressions
  1. +1
    -1
      requirements.txt
  2. BIN
      static/images/friends.jpeg
  3. +3
    -0
      static/styles/stylesheet.css
  4. +23
    -0
      templates/index.html
  5. +15
    -10
      vulnapp.py

+ 1
- 1
requirements.txt Voir le fichier

@@ -1 +1 @@
gunicorn==19.9.0
web.py==0.40

BIN
static/images/friends.jpeg Voir le fichier

Avant Après
Largeur: 600  |  Hauteur: 339  |  Taille: 48KB

+ 3
- 0
static/styles/stylesheet.css Voir le fichier

@@ -0,0 +1,3 @@
body {
background-color: whitesmoke
}

+ 23
- 0
templates/index.html Voir le fichier

@@ -0,0 +1,23 @@
$def with (name)

<head>
<title>Friends</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="static/styles/stylesheet.css">

</head>

<body>

<h1>Friends</h1>

<img src="static/images/friends.jpeg" alt="Friends">
$if name:
<p>I just wanted to say <em>hello</em> to $name.</p>
$else:
<p><em>Hello</em>, world!</p>

<h3>Login, or become a Friend!</h3>

</body>

+ 15
- 10
vulnapp.py Voir le fichier

@@ -1,11 +1,16 @@
def application(environ, start_response):
"""Simplest possible application object"""
data = str.encode('Hello, World!\n')
status = '200 OK'
response_headers = [
('Content-type','text/plain'),
('Content-Length', str(len(data)))
]
start_response(status, response_headers)
return iter([data])
import web
render = web.template.render('templates/')

urls = (
'/', 'application'
)

class application():

def GET(self):
name = 'Bob'
return render.index(name)
if __name__ == "__main__":
app = web.application(urls, globals())
app.run()

Chargement…
Annuler
Enregistrer