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 / [EMAIL PROTECTED] / http://blog.ianbicking.org _______________________________________________ Web-SIG mailing list [email protected] Web SIG: http://www.python.org/sigs/web-sig Unsubscribe: http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com
