468,469 Members | 1,733 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,469 developers. It's quick & easy.

How to create "cross-backend" python web app

Hi all-

I'm trying to port an ajax spell-checker
(http://www.broken-notebook.com/spell_checker/index.php) to use with
the moin moin wiki and have been somewhat successful. (By successful I
mean I can spell check using the php backend and my python port running
as cgi-bin).

My question is this: moinmoin runs on many python web backends
(cgi-bin/mod-python/twisted/standalone). My spell-checker backend runs
as cgi (disclaimer: I've done a bit of php and java(struts) web app
programming, but the last python related web programming I did was Zope
about 5 years ago (does that even count ? ;) )) because that was the
easiest for me to get up to speed on. What is the best way to write
cross-backend python web apps? Is there any abstraction I can use?
With cgi-bin, I use the python "cgi" module, which gives me easy access
to form variables, but I'd like to be able to deploy in the other
backends as well. What's the best way to do this? Or is a rewrite
required for each one?

thanks

matt

Jul 21 '05 #1
2 2064
"matt" <ma*************@gmail.com> wrote in message news:<11*********************@g43g2000cwa.googlegr oups.com>...
Hi all-

I'm trying to port an ajax spell-checker
(http://www.broken-notebook.com/spell_checker/index.php) to use with
the moin moin wiki and have been somewhat successful. (By successful I
mean I can spell check using the php backend and my python port running
as cgi-bin).
That looks like an interesting application/component.
My question is this: moinmoin runs on many python web backends
(cgi-bin/mod-python/twisted/standalone). My spell-checker backend runs
as cgi (disclaimer: I've done a bit of php and java(struts) web app
programming, but the last python related web programming I did was Zope
about 5 years ago (does that even count ? ;) )) because that was the
easiest for me to get up to speed on. What is the best way to write
cross-backend python web apps? Is there any abstraction I can use?
Although a kind of Web "middleware" standard called WSGI [1] has been
proposed to somehow alleviate these kinds of problems, I'd recommend
using WebStack [2] to implement a "cross-backend" solution which will
run on CGI, mod_python, Twisted, BaseHTTPServer and other
technologies.
With cgi-bin, I use the python "cgi" module, which gives me easy access
to form variables, but I'd like to be able to deploy in the other
backends as well. What's the best way to do this? Or is a rewrite
required for each one?


Some might argue that writing directly to WSGI would allow you to
re-use your CGI-based code moderately easily whilst having some
backend portability. I'd argue that WebStack's API is slightly more
high-level and that the WebStack distribution should provide you with
everything you need to deploy your application on the backends you've
chosen (plus others). Either way, you certainly don't need to rewrite
your application for every different environment any more.

Paul

[1] http://www.python.org/peps/pep-0333.html
[2] http://www.python.org/pypi/WebStack
Jul 21 '05 #2
Thanks Paul-

I'll look into WebStack.

Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Walter Quirtmair | last post: by
11 posts views Thread by taoberly | last post: by
reply views Thread by Peter Duniho | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.