Last active
August 29, 2015 14:22
-
-
Save potato4d/3d91837b24068f784851 to your computer and use it in GitHub Desktop.
Python Bottleを使ってみる ref: http://qiita.com/potato4d/items/a1ad71d3c9bf7fa046bc
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
@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/") |
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
/app.py メインのpythonコード | |
/views/ テンプレートファイルを保管 | |
/public_html/ 静的リソース置き場 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment