The best way to do web apps with Python?

Jon Perez jbperez808 at wahoo.com
Sun Jan 9 04:55:57 EST 2005


worzel wrote:
> What is the best way to web developemnt with Python? Is there anything 
> close to PHP style in-page script placement that can create and use 
> other Python objects? 

Spyce ( http://spyce.sf.net )  is what you're looking for.  I
was looking exactly for the same thing as you are - a PHP workalike -
and tried around half a dozen or so alternatives before I settled
upon Spyce as the best one.

If Spyce's [[ and ]] delimiters are not to your liking, you can
actually switch to using <% and %> without any problem.  Spyce
also handles the Python indent issue quite nicely and elegantly,
imo, while you can use the free and open source SciTE text editor
to separately syntax highlight Spyce source code + Javascript + HTML
very nicely (config file tweaking required).

> what is the expectataion of Python for this kind of 
> stuff? Would one use Python for certain other things but turn to PHP for 
> web apps - or would one use their Python skills in place of PHP?

Python can be a full (and superior) replacement for PHP.  The only
caveat would be third party hosting support.

The following post by on the Spyce mailing list (by Andy of
Neotitans.com web development) explains why:

"One major roadblock to Spyce and other Python server side
technologies seeing acceptance on the scale of PHP is the
fact that mod_python deployment on 3rd party shared hosting
solutions is more complex and involved than mod_php.  Apparently,
security considerations mean that each mod_python user will need
to get their own instance of an Apache server acting as a proxy
behind a central instance of an Apache server (which is what's
responsible for accepting requests at the shared server's http port).

A per-shared user Spyce proxy server approach would likely be
more economical (of server resources) and more easily set up than
multiple mod_python-enabled Apache server instances.

If your hosting solution will permit you to have your own
long-running processes (afaik, most won't :-( ), and if they
are willing make the necessary httpd.conf mods to pass Spyce
page requests over to your own instance of the Spyce proxy
server or their .htaccess setup allows you to do that yourself,
then you're all set.

I'm also happy to report that Spyce CGI works great on any
hosting solution that supports CGI and has Python installed.
This means that virtually all Linux-based hosting solutions
(including those ultra-cheap shared server ones) will support
Spyce CGI.

It would seem that FastCGI support is probably the hardest to
come by."




More information about the Python-list mailing list