Python, Forms, Databases

T

Tempo

I have been looking around for a few days for ways to use Python with
HTML forms. What I am interested in doing is placing the data that is
submited through an HTML form and collected by Python into a MySQL
database. I initially thought that I was going to be able to do this
with ASP, but I found out that my web hosting provider doesn't have ASP
support installed into their servers. Also, I couldn't find any dirt
cheap hosting providers that did support Pyton and ASP together. The
next solution I stumbled upon was to use Zope. However, I wasn't sure
if I should spend more of my time looking into this or not, and I found
a possible way around this, which is by using the CGI module. As you
can see, I am somewhat new to Python web programming and I have
confused myself. Can anybody name a few modules that I should look into
and these modules are the ones that will allow me to accomplish what I
am interested in doing? Thanks for your help.
 
J

John Salerno

Tempo said:
I have been looking around for a few days for ways to use Python with
HTML forms. What I am interested in doing is placing the data that is
submited through an HTML form and collected by Python into a MySQL
database. I initially thought that I was going to be able to do this
with ASP, but I found out that my web hosting provider doesn't have ASP
support installed into their servers. Also, I couldn't find any dirt
cheap hosting providers that did support Pyton and ASP together. The
next solution I stumbled upon was to use Zope. However, I wasn't sure
if I should spend more of my time looking into this or not, and I found
a possible way around this, which is by using the CGI module. As you
can see, I am somewhat new to Python web programming and I have
confused myself. Can anybody name a few modules that I should look into
and these modules are the ones that will allow me to accomplish what I
am interested in doing? Thanks for your help.

The host I use was cheap when I signed up (around $4/month) for a
personal site. You might try them: STP Web Hosting. They have ASP
support, and I recently asked them about Python and they turned that on
for me also.
 
L

Larry Bates

Tempo said:
I have been looking around for a few days for ways to use Python with
HTML forms. What I am interested in doing is placing the data that is
submited through an HTML form and collected by Python into a MySQL
database. I initially thought that I was going to be able to do this
with ASP, but I found out that my web hosting provider doesn't have ASP
support installed into their servers. Also, I couldn't find any dirt
cheap hosting providers that did support Pyton and ASP together. The
next solution I stumbled upon was to use Zope. However, I wasn't sure
if I should spend more of my time looking into this or not, and I found
a possible way around this, which is by using the CGI module. As you
can see, I am somewhat new to Python web programming and I have
confused myself. Can anybody name a few modules that I should look into
and these modules are the ones that will allow me to accomplish what I
am interested in doing? Thanks for your help.
I'll bet you'll find that the cheapest way to to this is to use
PHP and MySQL (both free on even the lowest cost hosting plans).
A LOT more low cost hosting plans include PHP than Python.

-Larry Bates
 
T

Tempo

Larry I do see your point. There does seem to be a lot more support for
PHP and MySQL together than there is Python and ASP. But I want to
first try to accomplish my goal by using Python first before I give up
and revert back to PHP. So if I was going to parse HTML forms and place
the data into a MySQL database, what should I use? CGI module? Zope?
Webware? Thanks for any and all help.
 
X

Xavier Morel

Tempo said:
Larry I do see your point. There does seem to be a lot more support for
PHP and MySQL together than there is Python and ASP. But I want to
first try to accomplish my goal by using Python first before I give up
and revert back to PHP. So if I was going to parse HTML forms and place
the data into a MySQL database, what should I use? CGI module? Zope?
Webware? Thanks for any and all help.
If you're talking about a pair of page and nothing more, the CGI module
and manually handling your stuff (with a DBAPI2 MySQL module for the DB
link) is more than enough.

If you want to create something more complex (a full database driven
website), it would probably be a good idea to check some of Python's web
frameworks, Django for example.
 
T

Tim Parkin

Xavier said:
If you're talking about a pair of page and nothing more, the CGI module
and manually handling your stuff (with a DBAPI2 MySQL module for the DB
link) is more than enough.

If you want to create something more complex (a full database driven
website), it would probably be a good idea to check some of Python's web
frameworks, Django for example.

Simple cgi example

http://www.ibiblio.org/obp/pyBiblio/tips/wilson/basiccgi.php

or you can go the more complex route which generates, validates and
parses forms for you.

http://divmod.org/trac/wiki/DivmodNevow/FormHandling

for which you'll need twisted sumo and pollenations forms package

Here is some sample code:

http://divmod.org/trac/attachment/wiki/DivmodNevow/FormHandling/Example1.2.tac.py

Tim Parkin
 
T

Terry Hancock

Pyton and ASP together. The next solution I stumbled upon
was to use Zope. However, I wasn't sure if I should spend
more of my time looking into this or not, and I found a
possible way around this, which is by using the CGI
module.

CGI, "ick!" :p

Zope, "mmm" :)

Actually, it's a bit of a pain to get Zope installed on your
server (or conversely, to get a server you're allowed to put
Zope on). But if you're willing to do that, it is going to
be *so* much easier to manage.

*If* you can do that, then it's a really simple way
to do what you want. This kind of thing is child's play once
you have a Zope site set up (you'll have to install a MySQL
Zope product, and possibly some helpful Zope products for
managing forms, if you don't want to do it the old-fashioned
way -- after that though, it's just
"throught-the-web" scripting).

But Zope is kind of a culture onto itself, so you may not
necessarily want to buy into it, if you don't do this kind
of thing often.

Just my two cents, of course,
Terry
 
B

Bruno Desthuilliers

Tempo a écrit :
Larry I do see your point. There does seem to be a lot more support for
PHP and MySQL together than there is Python and ASP. But I want to
first try to accomplish my goal by using Python first before I give up
and revert back to PHP. So if I was going to parse HTML forms and place
the data into a MySQL database, what should I use? CGI module? Zope?
Webware? Thanks for any and all help.

Depends on what your hosting provides. Zope seems definitively out of
the field - it's not the right tool for the job, and it requires
specific, professionnal hosting. I don't know to much about webware.
Pure CGI is a PITA. Something that may do the job just fine is Myghty (a
slightly enhanced Python port of Perl Mason). A great + for Myghty is
that it will scale if your app grows (Myghty runs on CGI, FastCGI,
mod_python, WSGI, and even on Python's HTTPServer).

My 2 cents
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top