Re: Please Teach me Web Frameworks for Python!
Posted: Jan 30, 2006 4:21 PM
> One thing i noticed reading all the comments is that
> hardly anyone mentions mod_python with PSP. Why is that?
> I've looked at both Django and TurboGears, and it all
> looks really good. There's just one problem, both
> frameworks require me to install quite a few python
> packages. Now that shouldn't be a problem for anyone
> running their own server, but for me it is. There's no way
> my webhoster will let me install all those packages, and
> chances are slim that he will do it for me.
> But he might/will/did install mod_python. And with that,
> there's a beginning of a web framework. But it seems none
> of the frameworks mentioned in this discussion has taken
> that as a starting point.
Well, I was asking myself the same question...
For a long time, I steered away of mod_python because I used to think it was too difficult or limited, compared to other solutions.
A few days ago, I started using it and I found it to be great!
It has its own implementation of PSP (python server pages) for coding a la PHP (mixing python and html) or you can use its "publisher" combined with PSP templates for separating presentation and logic. It's also posible to create a full website with a single script by mapping functions to URLs.
I think this is great because mod_python is python embeded into Apache. It has excellent performance and doesn't need any framework or additional package to work, although you can use Cheetah, for example, if you want an alternative to PSP templates.
The good thing about mp is that it doesn't force you to use any specific package for each task. You can use any database for which a python api exists, or any template language you want, but in any case only mod_python is ok.
I still think this is not as flexible as Karrigell, for example, because its session handling is a little bit tricky, but you get a very good performance in exchange.
Being a buddying programmer who codes as a hobby in my spare time, I could write a shopping cart, a records pagination script and an authomatic CRUD interface script in just a few hours.
In hands of an experienced developer, I think mod_python can be a very powerful tool.