Python, Forms, Databases

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tempo

    #1

    Python, Forms, Databases

    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.

  • John Salerno

    #2
    Re: Python, Forms, Databases

    Tempo wrote:[color=blue]
    > 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.
    >[/color]

    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.

    Comment

    • Larry Bates

      #3
      Re: Python, Forms, Databases

      Tempo wrote:[color=blue]
      > 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.
      >[/color]
      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

      Comment

      • Tempo

        #4
        Re: Python, Forms, Databases

        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.

        Comment

        • Xavier Morel

          #5
          Re: Python, Forms, Databases

          Tempo wrote:[color=blue]
          > 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.
          >[/color]
          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.

          Comment

          • Tim Parkin

            #6
            Re: Python, Forms, Databases

            Xavier Morel wrote:[color=blue]
            > Tempo wrote:
            >[color=green]
            >>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.
            >>[/color]
            >
            > 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.[/color]

            Simple cgi example

            http://www.ibiblio.org/obp/pyBiblio/...n/basiccgi.php

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



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

            Here is some sample code:



            Tim Parkin

            Comment

            • Bruno Desthuilliers

              #7
              Re: Python, Forms, Databases

              Tempo a écrit :[color=blue]
              > 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.[/color]

              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

              Comment

              • Terry Hancock

                #8
                Re: Python, Forms, Databases

                On 15 Feb 2006 11:13:08 -0800
                "Tempo" <bradfordh@gmai l.com> wrote:[color=blue]
                > 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.[/color]

                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

                --
                Terry Hancock (hancock@Anansi Spaceworks.com)
                Anansi Spaceworks http://www.AnansiSpaceworks.com

                Comment

                • Jeff  Reavis

                  #9
                  Re: Python, Forms, Databases

                  You should check out Spyce:
                  Spyce - Python Server Pages: a server-side language that supports simple and efficient Python-based dynamic HTML generation.


                  It will work under CGI as well as Fast CGI, ModPython, or its own built
                  in server.

                  It also has an ASP/JSP like syntax:
                  Spyce - Python Server Pages: a server-side language that supports simple and efficient Python-based dynamic HTML generation.


                  If you plan on getting a new hosting company you might also want to
                  look at TurboGears and Django.

                  -jjr

                  Comment

                  Working...