By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,101 Members | 1,335 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,101 IT Pros & Developers. It's quick & easy.

How to create "cross-backend" python web app

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
"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

P: n/a
Thanks Paul-

I'll look into WebStack.

Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.