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
11 changes: 10 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from jinja2 import Environment, FileSystemLoader
from bottle import route, run
import bottle

import random

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want this line back


JINJA_ENV = Environment(
loader=FileSystemLoader('templates/'),
Expand All @@ -15,6 +15,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 static/bronco.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/rainbowkitten.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions templates/image.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<body bgcolor="rgb({{red}}, {{green}}, {{blue}})">
<img src="/static/hand_sanitizer.png" />
<img src="/static/bronco.png" />
<img src="/static/rainbowkitten.jpg" />
</body>

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github wants a newline