1ファイルフレームワークBottleは気軽にWebAPIなどを実装する際に便利ですね。ResponseとRequestオブジェクトの使い方についてメモしておきます。 Request bottle.requestにアクセスすると、現在処理しているリクエストにアクセスできます。以下の例ではbottle.を省略します。 GETリクエストの場合のフォームパラメータ: request.query POST/PUTリクエストの場合のフォームパラメータ: request.forms GET/POST/PUT全部まぜこぜのフォームパラメータ request.params HTTPヘッダの取得: request.get_header('User-Agent') HTTPメソッド: request.method リクエスト本文(body): request.body アクセスされたURL: request.u
Recipes¶ This is a collection of code snippets and examples for common use cases. Keeping track of Sessions¶ There is no built-in support for sessions because there is no right way to do it (in a micro framework). Depending on requirements and environment you could use beaker middleware with a fitting backend or implement it yourself. Here is an example for beaker sessions with a file-based backen
Recently, I wrote a simple web tracker at work, using the Bottle microframework. Looking back, maybe I should've used Flask instead, as I simply don't see the reason for stuffing 3,000 lines of code in one file, other than a proof of concept. But both frameworks are quite similar, and both have quite good documentation. A simple bottle app looks like this: from bottle import route, run @route('/')
I'm using Jinja2 templates with Bottle.py and Google App Engine's dev_appserver for development. I want the templates to automatically reload on every request (or ideally only when they change), so that I don't have to keep restarting the server. According to bottle's docs, you're supposed to be able to disable template caching by calling bottle.debug(True). Jinja still seems to be caching its tem
I used Bottle, a Python framework, to create a quick and dirty RESTful service to allow simple CRUD operations on a bunch of XML files. About the task This is part of an larger, abondoned project, a simple recipe manager. Previous steps had left me with a set of XML files I can visualize in a browser by applying XSLT to them. I now need a quick and dirty way to manage those files directly from the
This webpage was generated by the domain owner using Sedo Domain Parking. Disclaimer: Sedo maintains no relationship with third party advertisers. Reference to any specific service or trade mark is not controlled by Sedo nor does it constitute or imply its association, endorsement or recommendation.
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く