Contents Pyramidのセキュリティの仕組み 認証 認可 アプリケーションでの実際 セキュリティ設定 ビューとモデル ログイン処理 まとめ 始めに断っておこう。Pyramidにはファンシーなログインフォームやユーザー管理なんてついてこない。 認証、認可の仕組みはあるが、Pyramidに設定一発で動くような押しつけがましいViewやModelは存在しない。 そういうのが好きな人はDjangoというフレームワークがあるから、そっちにしときな。 このエントリでは、Pyramidで認証、認可の仕組みを使う方法を説明する。 CSRFとかそういうのは扱わないのであしからず。 Pyramidのセキュリティの仕組み 先に述べたとおりPyramidには認証と認可の仕組みがある。 認証というのは、今アプリケーションを使っているのが誰なのかを特定するもので、 認可は誰がその機能や処理を実行してよいかと
Contents URLディスパッチ PyramidでのURLディスパッチ View Predicate ルートURL トラバーサル オブジェクトのデフォルトビュー ビュー名 リソースURL URLディスパッチとトラバーサルの比較 URLディスパッチとトラバーサルの混合 軽いURLディスパッチ + がっつりトラバーサル ガッツリURLディスパッチ + 軽くトラバーサル まとめ とりあえずコントローラースタイルと書いたが、ようするにWebアプリケーションがリクエストを受け取ってから処理に入るまでの流れである。 Pyramidはあえて複数の方法を採用している。その他のフレームワークから来る人たちがお気に入りの方法をとれるようにするためだ。 大きく分けて、Zope系由来のトラバーサル、DjangoやPylonsが使っているURLディスパッチがある。 (TurboGearsはPylons上のフレー
This one falls under: “I knew there has to be an easy way!” While there’s pyramid_celery, last time I checked it had several shortcomings (back then I couldn’t configure celerybeat) and I felt in general that it shouldn’t be necessary to add another dependency that may or may not lag behind pyramid’s and celery’s latest releases. I also don’t really care for configuring celery inside of an .ini fi
Cornice: A REST framework for Pyramid¶ Cornice provides helpers to build & document REST-ish Web Services with Pyramid, with decent default behaviors. It takes care of following the HTTP specification in an automated way where possible. We designed and implemented cornice in a really simple way, so it is easy to use and you can get started in a matter of minutes. Show me some code!¶ A full Cornice
April 29, 2013 In my two years @seantis I had the chance to work on web applications ranging from the small and benign to the big and bulky. For these applications I used (and cursed at) a number of web-frameworks: Flask Pyramid Django Plone I know there’s no shortage of blog posts comparing Python web-framworks, but I developed a certain view on these four frameworks which might be interesting to
これはpython advent calendar 2012の19日目の記事です。 何についての話? pyramidを使ったseparationの話です。間接参照すばらしい的な話につなげられたら良いです。 (MVC的にはsqlalchemy,mako,pyramid(のURLディスパッチ)を利用してます) ある学生寮向けのローカルSNSの開発 一昔前に流行ったローカルSNSのようなものを作ることになった。 ある学生寮の住人向けに作られるそうだ。そこに所属する学生が書いた日記などをまとめたりなどしたいらしい。 これは、住人の一覧画面の表示に使うview。他にも同様の形のviewがいくつも定義されている。 from pyramid.view import view_config @view_config(route_name="index", renderer="advent:template
Cornice: A REST framework for Pyramid¶ Cornice provides helpers to build & document REST-ish Web Services with Pyramid, with decent default behaviors. It takes care of following the HTTP specification in an automated way where possible. We designed and implemented cornice in a really simple way, so it is easy to use and you can get started in a matter of minutes. Show me some code!¶ A full Cornice
Python, Pyramid, Django | 10:05Pyramidの場合はreifyデコレータを使うまたshirlyのソースコードを読んでいたのですが、"?"と思うことがありました。 from pyramid.decorator import reify class ShirlyResource(object): …(中略) def query_project(self): return Project.query def add_project(self, project): return DBSession.add(project) @reify def project(self): if 'project_name' not in self.request.matchdict: return None try: project = self.query_project().
Kotti is a high-level, Pythonic web application framework. It includes a small and extensible CMS application called the Kotti CMS. Kotti is most useful when you are developing applications that have complex security requirements, use workflows, and/or work with hierarchical data. Built on top of a number of best-of-breed software components, most notably Pyramid and SQLAlchemy, Kotti introduces o
velruseは,oauth系の認証を一手に引き受けてくれるライブラリ 対応しているprovider Facebook OpenID Google Yahoo Twitter Windows Live 現時点でpypiに上がっているバージョンはsqlite3の対応に難が合った 直接githubから開発版をインストールすると良い。 easy_install -U https://github.com/bbangert/velruse/tarball/master リポジトリの中にサンプルアプリがあるので、これを参考にする。 と、ここまでは前置き。 consumer secretの管理とか面倒。 話したいのはここから先。oauthなどでログイン処理を書くとき、アプリ毎にconsumer keyやconsumer secretを取得する必要がある。 当然velruseにもそれらの値を渡して挙げる
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く