CGI - client information

Erik Max Francis max at
Sun Jan 5 11:11:30 CET 2003

Jesper Olsen wrote:

> Is it possible from a python cgi script to query the web server about
> the
> IP address of the client that is calling the script?
> E.g. the web server could provide this info in an environment
> variable.

Yes.  See the REMOTE_ADDR environment variable.  (This question really
is about CGI, not Python.)

> I have a hosted web-site, and I like to see who accesses it and what
> they
> look at, but it seems for some reason that the web server does not log
> access to the cgi directory...

You can probably configure your server to log that information.

 Erik Max Francis / max at /
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ The critical period in matrimony is breakfast-time.
\__/ A.P. Herbert
    Python chess module /
 A chess game adjudicator in Python.

More information about the Python-list mailing list