diff --git a/requirements.txt b/requirements.txt index 470bf60..90cd3f6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -gunicorn==19.9.0 +web.py==0.40 diff --git a/static/images/friends.jpeg b/static/images/friends.jpeg new file mode 100644 index 0000000..e71c1ed Binary files /dev/null and b/static/images/friends.jpeg differ diff --git a/static/styles/stylesheet.css b/static/styles/stylesheet.css new file mode 100644 index 0000000..4316b68 --- /dev/null +++ b/static/styles/stylesheet.css @@ -0,0 +1,3 @@ +body { + background-color: whitesmoke +} \ No newline at end of file diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..a6963d9 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,23 @@ +$def with (name) + + + Friends + + + + + + + +

Friends

+ + Friends + + $if name: +

I just wanted to say hello to $name.

+ $else: +

Hello, world!

+ +

Login, or become a Friend!

+ + diff --git a/vulnapp.py b/vulnapp.py index 2d43674..2b67f86 100644 --- a/vulnapp.py +++ b/vulnapp.py @@ -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()