Re: Adding abort and redirect to Pyramid

2011-05-16 Thread Stephen Lacy
This whole discussion (and current implementation of returns or raises for httpexceptions) seems to violate the Zen of Python: There should be one-- and preferably only one --obvious way to do it. Chris, what's the root issue that made you think that return abort(401) would be a better API than

Re: Terminology Change - Template to Skeleton

2011-03-21 Thread Stephen Lacy
Why not just cut to the chase and call them examples. They can then be fully fledged working applications, and users can be advised to copy them to their own directory structures before continuing. That's probably what everybody does anyway, right? Steve On Mon, Mar 21, 2011 at 12:06 PM, Mark

Re: What's the best way to optimize database connections in Pyramid?

2011-03-16 Thread Stephen Lacy
Since mod_wsgi uses long-lived processes, I've decided to keep the connection open for the life of the process (and auto-reconnect if there's a failure). I'm actually a little surprised that people here are connecting disconnecting with each request, as it feels unnecessary. Is there some

Re: Proper HEAD requests?

2011-03-14 Thread Stephen Lacy
Yeah, implicitly breaking HEAD sucks. :) Implicitly allowing POST data into GET requests also sucks. :) Steve On Mon, Mar 14, 2011 at 12:37 PM, Reed L O'Brien reedobr...@gmail.comwrote: On Mar 14, 2011, at 3:13 PM, Stephen Lacy wrote: On Fri, Mar 11, 2011 at 6:16 AM, Graham Dumpleton

Proper HEAD requests?

2011-03-10 Thread Stephen Lacy
What's the recommended way to get proper HEAD request support using pyramid + mod_wsgi? Right now, with my vanilla mod_wsgi configs, and request_method='GET' on my view_config decorators, my HEAD requests are 404'ing. I tried setting request_method=['GET', 'HEAD'] but it seems as this syntax

Re: Setting cookies in Pyramid for @action()s or HTTPFound redirects?

2011-03-10 Thread Stephen Lacy
To me, the answer to this question really lies in what session implementation are you using? For me, I've opted to use a session in a database on the server, which allows me to set arbitrarily large items into the session without any real penalty. Then, for whatever you'd set a custom cookie

Re: CSRF protection and session factories

2011-03-09 Thread Stephen Lacy
On Wed, Mar 9, 2011 at 11:24 AM, Stephen Lacy slacy+perso...@slacy.comwrote: CSRF protection is a fairly complex topic, and Pyramid's brief textual description in the docs above really glosses over many of the important aspects of how to handle CSRF protection. In my form handling view, I'm

Re: Some thoughts about Pyramid

2011-03-03 Thread Stephen Lacy
of encapsulation, that is something that every programmer should value. On Thu, Mar 3, 2011 at 12:24 PM, Chris McDonough chr...@plope.com wrote: On Thu, 2011-03-03 at 09:39 -0800, Stephen Lacy wrote: Okay, chiming in here. :) Yeah, this is my post. I've been pretty quiet here. Sorry