durusmail: quixote-users: Instructions for running as a CGI
Instructions for running as a CGI
2005-09-04
2005-09-05
Instructions for running as a CGI
Titus Brown
2005-09-05
-> It appears the directions in the docs for running Quixote applications
-> as a CGI are out of date. Functions referenced in the docs (like
-> process_cgi) seem not to exist anymore. Is there an updated reference
-> anywhere (such as the wiki) for doing this? I couldn't seem to figure it
-> out on my own.

Hi, Dan,

try the following (for a UNIX box):

1) copy server/cgi_server.py into a CGI-accessible filename, e.g.

        ~/public_html/cgi/test.cgi

2) edit 'test.cgi' and change '/usr/bin/env python' at the top to the
        location of your python, e.g.

        #! /usr/local/bin/python2.4

3) make sure that your Quixote app package is in the path, e.g. add

        sys.path.insert(0, '/u/t/dev/quixote2-tutorial/')

4) replace 'from quixote.demo import create_publisher' with your package
        'create_publisher', e.g.

        from hello import create_publisher

5) chmod +x the script

Then go access the CGI script via the Web, e.g.

        http://localhost/~t/cgi/test.cgi/

(the last '/' is important!)

If you want to try this with my hello.py package, you can download it
at

        http://darcs.idyll.org/~t/projects/quixote2-tutorial/hello.py

Note that you'll need to get rid of the 'print' statement in the
create_publisher function in order for it to work.

hope this helps,
--titus
reply