[Web-SIG] [Paste] Re: PasteDeploy 0.1
Ian Bicking
ianb at colorstudy.com
Tue Aug 23 22:16:00 CEST 2005
Michal Wallace wrote:
> I'm working on a similar problem, and I really like your approach
> here, but I feel like I'm going to have to reinvent the wheel for
> my particular framework, because it's RESTlike. See, in addition
> to each URL, I'd like to be able to dispatch based on the HTTP
> method (GET,PUT,POST,DELETE...)
>
> What would be nice (for me) is if you could do something like:
>
>
> GET / = config:static_root.ini
> POST /cms = config:filebrowser.ini
> * /blog = config:blog.ini
This shouldn't be a problem (in paste.deploy or the alternatives we're
discussing) -- the "urlmap" I refer to is just (not very complicated)
Python code. You could do the same thing dispatching on HTTP methods.
With paste.deploy you'd do something like:
[composit:main]
use = egg:MyFramework#httpdispatch
GET = config:static_root.ini ...
...
If you want to do both at once (dispatch both on path like urlmap, and
on HTTP method) you'd have to make something like urlmap that also keeps
track of methods, and use "GET / = ...". Potentially urlmap could
support all of these (maybe not all as egg:Paste#urlmap, but with the
same basic code). Right now it matches based on path prefix and domain,
and I've meant to add ports, and HTTP method would be easy enough.
--
Ian Bicking / ianb at colorstudy.com / http://blog.ianbicking.org
More information about the Web-SIG
mailing list