Deron Meranda
deron.meranda at gmail.com
Thu Nov 2 17:54:35 EST 2006
On 11/2/06, Graham Dumpleton <grahamd at dscpl.com.au> wrote: > > There are (too?) many python web frameworks. > > Agreed. What is also annoying is that none are really truly integrated with > mod_python and the Apache way of doing things. Instead they use the response > handler phase of mod_python as merely a jumping off point. A framework that > properly integrates with mod_python and Apache and harnesses the fact that > there are other modules for Apache which aren't written in Python and which can > be used would be quite powerful. Although not fully integrated, at least I know about the Myghty framework which is "decently" integrated. It exposes the underlying mod_python request object and makes it available in it's templating system. So I write a lot of mod_python handlers for different phases, etc. in plain old mod_python; then I create Python objects of things, stuff them into the req object, and then in Myghty I access those values just like any other variable; and can even push values back into the req object too. Note that I'm not talking about serializing objects or pushing them into cookies. The actual python object I create in a mod_python handler in an early phase is directly accessible in Myghty. And it's even pretty easy to link together the mod_python session object and the Myghty session objects. But other than that single data point, in general I agree that mod_python integration is rather poor with other frameworks. But I'd like to think that it is mainly because mod_python is just being improved too quickly by Graham for the framework developers to keep up the same pace. > One sees various people complain about mod_python. In some cases their claims > are valid, but in other cases they are wrong and haven't bothered to work out > how it works. Even when their claims are valid, they often don't understand the > problem properly. To use mod_python properly also means in a lot of cases > understanding how Apache works, which many are too lazy to do. For example, the > difference between SetHandler and AddHandler and what happens when MultiViews > is enabled. I really blame the Apache httpd group here. They do a great job of documenting all the directives, but a really poor job of documenting the central "how it works" concepts. Just trying to find ANY useful information about the various request processing phases is quite hard; and even then you'll find a really old out of date unfinished beta-document on the subject. I know for me, a lot of mod_python didn't really click until I did some code diving sessions into the httpd source code to see what Apache was doing. I've been thinking about writing up some of this basic how-it-works stuff for the mod_python wiki. > Anyway, that has satisfied by need for a Friday rant. :-) Wow, and those of us on the other side of the globe get to enjoy it on Thursday. -- Deron Meranda
|