An Introduction To Repoze

14

Click here to load reader

description

A presentation introducing the Repoze project, which is a project to (amongst other things) implement WSGI support in Zope . This was presented by Tim Knapp of Emerge Technology at the NZPUG Christchurch meetup in April 2008.

Transcript of An Introduction To Repoze

Page 1: An Introduction To Repoze

An Introduction to

Tim Knapp, Emerge Technology

Page 2: An Introduction To Repoze

Repoze and WSGI

● WSGI standard began in 2004● Repoze began in 2007● Repoze is about:

– allowing non-Zope developers to take advantage of Zope technologies via WSGI

– allowing Zope developers to take advantage of WSGI components

Page 3: An Introduction To Repoze

WSGI Components

● Servers accept requests from browsers/clients and pass request data along to applications. They also respond to requests using data returned by the application.

● Middleware is an application that calls "the next" application; functional composition forms a "pipeline".

● Applications return status, headers, response body.

Page 4: An Introduction To Repoze

Middleware Is Cool

● Deliverance, HTML/XML output transformation. Repoze.org.

● evalerror, catch exceptions and query information about them via a browser.

● repoze.tm, move transaction management out of the publisher and into middleware.

● repoze.pam, move authentication out of apps.● repoze.profile, do Python profiling via

middleware.● repoze.errorlog, see exception history via

middleware.

Page 5: An Introduction To Repoze

Why Do Zope Users Care?

● Python web frameworks which have embraced WSGI:

● Python web frameworks which haven't:

Page 6: An Introduction To Repoze

Top-Level Packages

● repoze.zope2

● repoze.plone

● repoze.grok

Page 7: An Introduction To Repoze

repoze.zope2

● Re-implementation of Zope 2's ZPublisher to fit into a WSGI stack "natively".

● As a result, run Zope2 within Apache using mod_wsgi.

● Goal: 100% backwards compatibility with all Zope 2 products.

● Goal: 100% egg-based package installation.● Goal: move many Zope 2 features out into

middleware.

Page 8: An Introduction To Repoze

Dependencies

● repoze.zope2 depends heavily on Ian Bicking's Paste, particularly PasteDeploy, which provides a declarative syntax for configuring WSGI "pipelines".

● Phillip Eby's setuptools.

Page 9: An Introduction To Repoze

repoze.zope2 in Development

Page 10: An Introduction To Repoze

repoze.zope2 in a Deployment

Page 11: An Introduction To Repoze

What's Different

● No effort so far to make repoze.zope2 work on Windows (but not actively preventing it).

● Zope 2's standard_error_message doesn't do anything (a generic 500/404 error handler in "httpexceptions" replaces it).

● The Zope 2 error_log object doesn't log exceptions.

● zopectl is gone, replaced with single-purpose scripts.

Page 12: An Introduction To Repoze

Installing and Starting

● easy_install and virtualenv based via http://repoze.org/quickstart.html.

● Buildout-based via http://svn.repoze.org/buildouts.

● bin/paster serve etc/zope2.ini

Page 13: An Introduction To Repoze

Let's See It

Page 14: An Introduction To Repoze

● http://www.repoze.org● irc://irc.freenode.net#repoze● http://lists.repoze.org