[mod_python] mod_python or wsgi

Graham Dumpleton graham.dumpleton at gmail.com
Thu Jul 10 01:15:02 EDT 2008


2008/7/10 Sean Allen <sean at monkeysnatchbanana.com>:
> We are doing a 'side port' from mod_perl over to python of a large mess of
> code.
>
> Largely because developers keep getting tripped up on the idiomatic nature
> of OO perl.
>
> The initial idea was to move everything to mod_python as it seemed the
> closet sidestep.
> Looking for advice on the validity of that idea. Would it be as easy to move
> mod_perl code
> to wsgi as mod_python?
>
> i know the advantages of wsgi in terms of portability by that isnt the issue
> right now,
> getting it done as quickly and as easily as possible is.
>
> thoughts? experiences? comments?

Does your mod_perl code rely on being able to use Apache handler
phases other than the content handler phase? How much does it depend
upon mod_perl APIs to Apache libraries and internals? In other words,
is it just a content provider, or is it doing more than that and
hooking right into low levels of Apache?

If not hooking into Apache low level APIs, there certainly isn't much
point making your code mod_python specific and therefore not portable
to other hosting mechanisms if that would be a desirable point. Be
aware also that mod_perl exposes a much larger API to Apache stuff
than mod_python and there wouldn't be a direct correspondence when
trying to do a literal port anyway. Templating systems are also
potentially quite different as well.

Either way, I'd suggest there would be a fair bit of effort and using
one of mod_python or some WSGI toolkit/framework over the other isn't
probably going to save you much. So, more importantly, what sort of
features do you need as far as dispatch, templating, session support,
authentication, authorisation etc and at what level do you want to be
able to program, right at the low level, or are higher level
abstractions frameworks more desirable.

Graham


More information about the Mod_python mailing list