Latest Version: 0.9.6.2
  Dashboard > Pylons Official Docs > Home > Development Version
  Pylons Official Docs Log In | Sign Up   View a printable version of the current page.  
  Development Version
Added by Philip Jenvey, last edited by Ben Bangert on Apr 05, 2008  (view change)
Labels: 
(None)

Using the latest 0.9.7 beta

Read the Easy Install documentation, to decide whether to install Pylons as a root user so it can be used by everyone or whether to use a custom installation location.

If you have easy install run:

1
$ easy_install -f http://pylonshq.com/download/0.9.7 -U Pylons

Otherwise download ez_setup.py and run:

1
$ python ez_setup.py -f http://pylonshq.com/download/0.9.7 -U Pylons

Working Directly From the Source Code

Mercurial must be installed to retrieve the latest development source for Pylons. Mercurial packages are also available for Windows, MacOSX, and other OS's.

Check out the latest code:

1
$ hg clone https://www.knowledgetap.com/hg/pylons-dev Pylons

To tell setuptools to use the version you are editing in the Pylons directory:

1
2
$ cd Pylons
$ python setup.py develop

Now you can make changes to the files in the Pylons directory and the code will run exactly as if you had installed a version of the egg with the changes you have made.

Pylons development version (0.9.7) requires configuring three middlewares that earlier versions of Pylons handled automatically. To make your app compatible with both 0.9.6 and the development version, add the following to middleware.py below the "# CUSTOM MIDDLEWARE HERE" line:

1
2
3
4
5
6
7
8
import pylons
if pylons.__version__ >= "0.9.7":
    # Routing/Session/Cache Middleware
    from beaker.middleware import CacheMiddleware, SessionMiddleware
    from routes.middleware import RoutesMiddleware
    app = RoutesMiddleware(app, config['routes.map'])
    app = SessionMiddleware(app, config)
    app = CacheMiddleware(app, config)

Posted by Mike Orr at Nov 08, 2007 00:34 | Permalink

Pylons 0.9.7 will use request/response objects from WebOb instead of WSGIRequest/WSGIResponse. This brings a richer set of convenience attributes but also some API changes. If you're using

Unknown macro: {response.write("ABC")}
to build a page incrementally, you'll have to change it to
Unknown macro: {response.body_file.write("ABC")}
. Here's a general comparision of the two systems.

WebOb is only partially implemented in Pylons-dev as of this writing. Successful responses use WebOb.Response, while 404 errors (at least) use WSGIResponse. If you need the numeric status in a routine that could get either, do something like this:

Unknown macro: { try}

Posted by Mike Orr at Nov 29, 2007 23:28 | Permalink

Darn Confluence syntax. Why does it have to be different than other wikis?

Pylons 0.9.7 will use request/response objects from WebOb instead of WSGIRequest/WSGIResponse. This brings a richer set of convenience attributes but also some API changes. If you're using ``response.write("ABC")`` to build a page incrementally, you'll have to change it to ``response.body_file.write("ABC")``. Here's a general comparision of the two systems.

WebOb is only partially implemented in Pylons-dev as of this writing. Successful responses use WebOb.Response, while 404 errors (at least) use WSGIResponse. If you need the numeric status in a routine that could get either, do something like this:

Error formatting macro: code: Traceback (innermost last): File "<string>", line 1, in ? File "/var/confluence/plugin-cache/pygments-macro-plugin-0.1.5.jar/Lib/pygments/lexers/__init__$py.class", line 83, in get_lexer_by_name ClassNotFound: no lexer for alias 'pylons' found

try:
status = response.status_int # webOb response
except AttributeError:
status = response.status_code # WSGIResponse

Posted by Mike Orr at Nov 29, 2007 23:31 | Permalink

See pylonscookbook:What's new in Pylons 0.9.7? for changes already in the development version that affect your application, and pylonscommunity:Pylons Roadmap to 1.0 for a list of future planned changes.

Posted by Mike Orr at Dec 10, 2007 21:44 | Permalink
Site running on a free Atlassian Confluence Open Source Project License granted to Pylons. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.3.3 Build:#645 Feb 13, 2007) - Bug/feature request - Contact Administrators
Top