Created
October 28, 2011 16:34
-
-
Save dannystaple/1322703 to your computer and use it in GitHub Desktop.
Simple bottle example
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
from bottle import * | |
@route("/test") | |
def test(): | |
return "<h1>Hello!</h1>" | |
run(host = "localhost", port=8100) |
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
Bottle server starting up (using WSGIRefServer())... | |
Listening on http://localhost:8100/ | |
Use Ctrl-C to quit. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This example will only listen on localhost. This is not a firewall problem. To make it listen on all interfaces, the host should be set to "0.0.0.0". Take a look closely at the host param at http://bottlepy.org/docs/dev/api.html#module-contents for detail.