Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions anotherTest.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
more text
10 changes: 10 additions & 0 deletions src/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from jinja2 import Environment, FileSystemLoader
from bottle import route, run
import bottle
import random


JINJA_ENV = Environment(
Expand All @@ -15,6 +16,15 @@ def say_hi(name):
'name': name
})

@route('/image')
def show_image():
return respond('image.html',
{
'red': random.randint(0,255),
'green': random.randint(0,255),
'blue': random.randint(0,255),
})


@route('/static/<asset:path>')
def serve_asset(asset):
Expand Down
Binary file added templates/hand_sanitizer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions templates/image.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<body bgcolor="rgb({{red}}, {{green}}, {{blue}})">
<img src="/static/hand_sanitizer.png" />
</body>
3 changes: 3 additions & 0 deletions templates/image.html.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<body bgcolor="rgb({{red}}, {{green}}, {{blue}})">
<img src="/static/hand_sanitizer.png" />
</body>
1 change: 1 addition & 0 deletions test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
text