using CGIHTTPserver to test html forms

Discussion in 'Python' started by William D. Gill, Feb 23, 2004.

  1. I use a notebook (win 98) because of its portability. Unfortunately it is
    very slow. When I try to develop and test python cgi scripts I use Xitami
    as a local server, but with python, Xitami, and my text editor running it
    becomes next to impossible to work. The keyboard and mouse are slowed to
    painful levels. Actual execution of the webpage/script is tolerable, but to
    edit I have to stop the server. I was wondering if using CGIHTTPserver
    would be a better solution and if anyone can give me an example script
    (simple enough for a newbie). Every reference I see to CGIHTTPserver says
    it's good for testing your web forms, but they don't show me how.

    Thanks

    Bill
    William D. Gill, Feb 23, 2004
    #1
    1. Advertising

  2. William D. Gill

    bblochl Guest

    William D. Gill schrieb:

    >I use a notebook (win 98) because of its portability. Unfortunately it is
    >very slow. When I try to develop and test python cgi scripts I use Xitami
    >as a local server, but with python, Xitami, and my text editor running it
    >becomes next to impossible to work. The keyboard and mouse are slowed to
    >painful levels. Actual execution of the webpage/script is tolerable, but to
    >edit I have to stop the server. I was wondering if using CGIHTTPserver
    >would be a better solution and if anyone can give me an example script
    >(simple enough for a newbie). Every reference I see to CGIHTTPserver says
    >it's good for testing your web forms, but they don't show me how.
    >
    >Thanks
    >
    >Bill
    >
    >
    >
    >
    >
    >

    #httpd.py

    from BaseHTTPServer import HTTPServer
    from CGIHTTPServer import CGIHTTPRequestHandler
    serveradresse = ("",8080)
    server = HTTPServer(serveradresse, CGIHTTPRequestHandler)
    server.serve_forever()

    I have tried that on Win2k starting in the editor Window of IDle and
    Python will hang. (On other systems it works ok - I have not found the
    reason yet!) On my linux- system I have no problems of that kind. On a
    Windows-network I couldn`t get it to work at all.

    On my test-sytem (Win2k) it works well, if you start it from a
    DOS-Window from the DOS-Prompt by typing
    python httpd.py
    The html-files must be in the same directory a s the file httpd.py.
    cgi-files must reside in a subdirectory namend cgi-bin.

    To test for instance the html-file name.html, you start the local server
    by typing http://localhost:8080/name.html (or 127.0.0.1:8080/name.html)
    in the browser adress line.

    Best regards and good luck!
    Bernhard
    bblochl, Feb 23, 2004
    #2
    1. Advertising

  3. I'll try it and let you know.

    Thanks,

    Bill

    "bblochl" <> wrote in message
    news:...
    > William D. Gill schrieb:
    >
    > >I use a notebook (win 98) because of its portability. Unfortunately it

    is
    > >very slow. When I try to develop and test python cgi scripts I use

    Xitami
    > >as a local server, but with python, Xitami, and my text editor running it
    > >becomes next to impossible to work. The keyboard and mouse are slowed to
    > >painful levels. Actual execution of the webpage/script is tolerable, but

    to
    > >edit I have to stop the server. I was wondering if using CGIHTTPserver
    > >would be a better solution and if anyone can give me an example script
    > >(simple enough for a newbie). Every reference I see to CGIHTTPserver

    says
    > >it's good for testing your web forms, but they don't show me how.
    > >
    > >Thanks
    > >
    > >Bill
    > >
    > >
    > >
    > >
    > >
    > >

    > #httpd.py
    >
    > from BaseHTTPServer import HTTPServer
    > from CGIHTTPServer import CGIHTTPRequestHandler
    > serveradresse = ("",8080)
    > server = HTTPServer(serveradresse, CGIHTTPRequestHandler)
    > server.serve_forever()
    >
    > I have tried that on Win2k starting in the editor Window of IDle and
    > Python will hang. (On other systems it works ok - I have not found the
    > reason yet!) On my linux- system I have no problems of that kind. On a
    > Windows-network I couldn`t get it to work at all.
    >
    > On my test-sytem (Win2k) it works well, if you start it from a
    > DOS-Window from the DOS-Prompt by typing
    > python httpd.py
    > The html-files must be in the same directory a s the file httpd.py.
    > cgi-files must reside in a subdirectory namend cgi-bin.
    >
    > To test for instance the html-file name.html, you start the local server
    > by typing http://localhost:8080/name.html (or 127.0.0.1:8080/name.html)
    > in the browser adress line.
    >
    > Best regards and good luck!
    > Bernhard
    >
    >
    >
    William D. Gill, Feb 23, 2004
    #3
  4. Sorry it took so long to get back. That worked fine.

    I may wrap things up in something like the pydocgui so that I can select
    different documents, and shut it down more gracefully. If I do, I'll post
    the code.

    Thanks again,

    Bill

    "William D. Gill" <> wrote in message
    news:30ea7$403a277d$42a655ea$...
    > I'll try it and let you know.
    >
    > Thanks,
    >
    > Bill
    >
    > "bblochl" <> wrote in message
    > news:...
    > > William D. Gill schrieb:
    > >
    > > >I use a notebook (win 98) because of its portability. Unfortunately it

    > is
    > > >very slow. When I try to develop and test python cgi scripts I use

    > Xitami
    > > >as a local server, but with python, Xitami, and my text editor running

    it
    > > >becomes next to impossible to work. The keyboard and mouse are slowed

    to
    > > >painful levels. Actual execution of the webpage/script is tolerable,

    but
    > to
    > > >edit I have to stop the server. I was wondering if using CGIHTTPserver
    > > >would be a better solution and if anyone can give me an example script
    > > >(simple enough for a newbie). Every reference I see to CGIHTTPserver

    > says
    > > >it's good for testing your web forms, but they don't show me how.
    > > >
    > > >Thanks
    > > >
    > > >Bill
    > > >
    > > >
    > > >
    > > >
    > > >
    > > >

    > > #httpd.py
    > >
    > > from BaseHTTPServer import HTTPServer
    > > from CGIHTTPServer import CGIHTTPRequestHandler
    > > serveradresse = ("",8080)
    > > server = HTTPServer(serveradresse, CGIHTTPRequestHandler)
    > > server.serve_forever()
    > >
    > > I have tried that on Win2k starting in the editor Window of IDle and
    > > Python will hang. (On other systems it works ok - I have not found the
    > > reason yet!) On my linux- system I have no problems of that kind. On a
    > > Windows-network I couldn`t get it to work at all.
    > >
    > > On my test-sytem (Win2k) it works well, if you start it from a
    > > DOS-Window from the DOS-Prompt by typing
    > > python httpd.py
    > > The html-files must be in the same directory a s the file httpd.py.
    > > cgi-files must reside in a subdirectory namend cgi-bin.
    > >
    > > To test for instance the html-file name.html, you start the local server
    > > by typing http://localhost:8080/name.html (or 127.0.0.1:8080/name.html)
    > > in the browser adress line.
    > >
    > > Best regards and good luck!
    > > Bernhard
    > >
    > >
    > >

    >
    >
    William D. Gill, Feb 23, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Hansen

    Re: Securing PyDoc and CGIHTTPserver

    Peter Hansen, Jul 10, 2003, in forum: Python
    Replies:
    7
    Views:
    411
    Peter Hansen
    Jul 15, 2003
  2. Shane Hathaway

    Re: Securing PyDoc and CGIHTTPserver

    Shane Hathaway, Jul 10, 2003, in forum: Python
    Replies:
    1
    Views:
    362
    Shane Hathaway
    Jul 11, 2003
  3. vincent delft

    CGIHTTPserver looze PYTHONPATH

    vincent delft, Jul 13, 2003, in forum: Python
    Replies:
    1
    Views:
    434
    vincent_delft
    Jul 13, 2003
  4. Andy Worms

    CGIHTTPServer security Breach

    Andy Worms, Jul 22, 2003, in forum: Python
    Replies:
    0
    Views:
    361
    Andy Worms
    Jul 22, 2003
  5. Joel Ross
    Replies:
    0
    Views:
    209
    Joel Ross
    Sep 4, 2003
Loading...

Share This Page