Web devel with python. Whats the best route?

Lele Gaifax lele at seldati.it
Tue Jan 9 06:46:39 EST 2001


>>>>> On 09 Jan 2001 09:14:49 +0200, Erno Kuusela <erno-news at erno.iki.fi> said:

    EK> In article <93cqvi0191h at news1.newsguy.com>, "Alex Martelli"
    EK> <aleaxit at yahoo.com> writes:

    EK> | "Session continuity" will have to be provided via cookies,
    EK> but that's | not really all that hard

    EK> note that mod_python and mod_snake are in the same boat
    EK> (modulo libraries they may or may not provide?) because they
    EK> also run with multiple processes.

Yes, there is no way out: the Apache server itself is actually
composed by N child daemons. But while Apache alone consumes one
process for every request, with mod_* you have N "long running"
interpreters that handle them.

    EK> lately i've come to the conclusion that the best way to do
    EK> session tracking (certainly better than cookies) is to
    EK> generate a unique id and put it in the url as a path
    EK> component. something like
    EK> http://my.site/my-program/0dj2/operation or whatever.  you can
    EK> use map the unique to (sequence of?) words from
    EK> id/usr/dict/words if you want to make the url
    EK> human-rememberable :)

As said, I think most mod_* out there do help here: while with
standard CGI you have to "open" a connection with whatever contains
the session database (in your example, the data associated with
session "0dj2") *at every request*, generally with the extmods you can
have *only one* per daemon.

The same is true for module import.

So, to answer the original question: there isn't necessarily just
/one/ "best" route, as usual... it depends on what you are doing. They
all provide facilities not available in standard C. If you already
have CGIs written in Python, then maybe PyApache can help on the speed
front; if you are starting from scratch, maybe the "higher" POV
provided by mod_[python,snake] would fit better.

bye, lele.
-- 
nickname: Lele Gaifax	| Quando vivro' di quello che ho pensato ieri
real: Emanuele Gaifas	| comincero' ad aver paura di chi mi copia.
email: lele at seldati.it	|		-- Fortunato Depero, 1929.





More information about the Python-list mailing list