Skip to content

Instantly share code, notes, and snippets.

@potato4d
Last active August 29, 2015 14:22
Show Gist options
  • Save potato4d/3d91837b24068f784851 to your computer and use it in GitHub Desktop.
Save potato4d/3d91837b24068f784851 to your computer and use it in GitHub Desktop.
Python Bottleを使ってみる ref: http://qiita.com/potato4d/items/a1ad71d3c9bf7fa046bc
@route('/')
def index():
# Logic
return template("index")
@route('/', method="POST")
def do_process():
# Logic
value = request.forms.get('foo')
return template("result", value)
@route('/<filepath:path>', name='static_file')
def static(filepath):
return static_file(filepath, root="./public_html/")
/app.py メインのpythonコード
/views/ テンプレートファイルを保管
/public_html/ 静的リソース置き場
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment