Created
June 24, 2013 02:06
-
-
Save k0emt/5847334 to your computer and use it in GitHub Desktop.
Bottle example. The tpl file belongs in a views subdirectory.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%for thing in things: | |
<li>{{thing}}</li> | |
%end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bottle | |
@bottle.route('/') | |
def home_page(): | |
mythings = ['apple','orange','banana','peach'] | |
return bottle.template('hello_world', username='Leandro', things=mythings) | |
bottle.debug(True) | |
bottle.run(host='localhost', port=8080) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment