The Artima Developer Community
Sponsored Link

Python Buzz Forum
Paste Deployment 0.1

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Ian Bicking

Posts: 900
Nickname: ianb
Registered: Apr, 2003

Ian Bicking is a freelance programmer
Paste Deployment 0.1 Posted: Oct 7, 2005 1:13 AM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Ian Bicking.
Original Post: Paste Deployment 0.1
Feed Title: Ian Bicking
Feed URL: http://www.ianbicking.org/feeds/atom.xml
Feed Description: Thoughts on Python and Programming.
Latest Python Buzz Posts
Latest Python Buzz Posts by Ian Bicking
Latest Posts From Ian Bicking

Advertisement

I wrote about it on the Paste blog but I thought I'd note Paste Deploy here as well (release page). It's still a very young project (like three days old), but I'm feeling optimistic about it, and in various forms I've been thinking about it for some time.

Basically it's a way to configure WSGI applications. For applications that support this (or where you write some very minimal glue) you could do things like this (note that I haven't made any of these Paste tools available yet, this is an example only):

[DEFAULT]
admin_email = me@example.com

# pipeline puts some filtering middleware in front of an app
[composit:main]
use = egg:Paste#pipeline
pipeline = login urldispatch

# Put one login system in front of entire site
[filter:login]
use = egg:Paste#login
database = mysql://localhost/userdb
table = users

# Then this passes different path prefixes to different apps
[composit:urldispatch]
use = egg:Paste#urlmap
/ = static
/cms = filebrowser
/blog = blog

# a very simple app...
[app:static]
use = egg:Paste#static
document_root = /home/me/htdocs

# this puts the auth in front of the app
[composit:filebrowser]
use = egg:Paste#pipeline
pipeline = auth filebrowser_app

# the login filter should give us a username; this just restricts
# who can access
[filter:auth]
use = egg:Paste#auth
require_role = admin

# this application is distributed 
[app:filebrowser_app]
use = egg:FileBrowser
document_root = /home/me/htdocs

[app:blog]
# In this case the app isn't distributed as an Egg with
# entry_points, so we manually create a glue function blog_app  
paste.app_factory1 = myglue.apps:blog_app

Well... that's a fairly involved configuration, really. You can move parts of this to other files fairly easily, substituting config:config_file.ini for the references to sections (blog, static, etc). While many of the pieces (like egg:Paste#auth) don't work now, they will very soon -- many of these things exist in Paste or elsewhere, and just need a configuration shell. There's a few other outstanding issues, but I'm very optimistic.

I'm also optimistic about breaking Paste up into smaller chunks that are easier to integrate into other projects; this package is my first attempt at distributing one piece of the project in isolation.

Read: Paste Deployment 0.1

Topic: Python Paste Power Previous Topic   Next Topic Topic: Good project idea: mileage.project

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use