Skip to content. | Skip to navigation

Personal tools

Navigation

You are here: Home / Tutorial / Pyramid Framework

Pyramid Framework

包括 Kotti 內容管理系統

檔案系統 O'Reilly Video Tutorial @pythonfinland Video: blog,

Gluino: port of web2py libs to bottle, flask, pyramid, tornado (includes copy of modules from the web2py framework)

Flask vs. Django vs. Pyramid vs. Plone Django vs Pyramid Pyramid vs Django vs Flask

Plone vs Django vs Tornado vs Pyramid vs Flask: Tornado 缺乏 404 error 處理機制,適合非同步存取機制的大型網站。

subprocess_middleware was built to support rendering Python generated JSON into HTML using a nodejs.

serve up different templates based on different routes Serve with Twisted Scaling with Multiple Client Instances TALES Template 執行效率比 Python Expression 來得差

範例

marioidival LiveCoding awesome pyramid pyramid_packages_domo

Google App Engine Kiwi PyCon 2013 Tim Knapp: slide video github

Long Polling

TicTacToe and Long Polling

Sphinx Documentation Integration KARL project case

Porting an Existing Application

Windows + MySQL

Deployment: Gunicorn

身份驗證與授權

種類很多oAuth 是常見的驗證服務,可以使用 Velruse 作為認證模組,或是使用 pyramid-oauth2 模組。其他的模組像 PersonaMACAuth

Google App Engine

通常有兩種方式

buildout 記得確認 SDK 下載版本號碼,雖然 bin/buildout 成功了,但 ../../bin/python setup.py test 遇到 ImportError: No module named mock (/home/marr/kotti_site/local/lib/python2.7/site-packages/kotti/tests/__init__.py)

Kotti

起手文件 Kotti 角色類似 Zope2 CMF,不過只存在一個網站物件,存取方式較 Plone 簡化許多。

傳回項目清單來顯示的範例

from pyramid.view import view_config
from kotti.resources import Document

@view_config(name='myview', renderer='mytemplate.pt', ...)
def myview(context, request):
  documents = Document.query.filter(<whatever your criteria are>)
  return {'documents': documents}
<li tal:repeat="d documents"><a href="request.resource_url(d)">${document.title}</a></li>

在 app.ini 檔案 kotti.site_title 可以使用中文標題,但有辦法做到 multilingual 嗎?

Eucalyptus Management Console Command Line Script Tool

https://devcenter.heroku.com/articles/creating-apps
https://devcenter.heroku.com/articles/git

使用者資料欄位客製化可以修改 Principals Ordering Fields in colander based Schemas

Relation 範例 kotti_image ElasticSearch

https://github.com/koansys/heroku-kotti 太舊了

Andreas Kaiser: zope.testbrowser wsgi_intercept are the Python 2 only requirements

參與貢獻

http://docs.pylonsproject.org/en/latest/#contributing

http://docs.pylonsproject.org/en/latest/community/featuresbugs.html#working-on-code

Kotti CMS like Plomino Intranet AngularJS with Kotti

frontend decoupled from backend: 1 2