Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!panix!not-for-mail From: Grant Edwards Newsgroups: comp.lang.python Subject: Re: Referrer key missing form os.environ dictionary? Date: Wed, 25 Sep 2013 18:37:27 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 33 Message-ID: References: <5242f8bc$0$30000$c3e8da3$5496439d@news.astraweb.com> NNTP-Posting-Host: dsl.comtrol.com X-Trace: reader1.panix.com 1380134247 23976 64.122.56.22 (25 Sep 2013 18:37:27 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Wed, 25 Sep 2013 18:37:27 +0000 (UTC) User-Agent: slrn/1.0.1 (Linux) Xref: csiph.com comp.lang.python:54753 On 2013-09-25, ?????????? wrote: > ???????? 25/9/2013 6:18 ????, ??/?? Grant Edwards ????????????: >>> The Referer is not an environment variable. >> >> It is when you're writing a CGI app. >> >>> How would your shell know what URL you were just browsing? >> >> Because the HTTP server sets those environment variables before >> invoking the CGI app. > > So you mean that even if i run it via shell this stement will also > work If the shell was started by the HTTP server, yes. If you logged in normally, no. > because it happens to be in the same enviroment with the HTTP server? The shell will only have that environment if the shell was run by the HTTP server. > No need to run it via web browser and check the Apache's error log? You can set the environemnt variables appropriately in the shell and then invoke a CGI application directly for testing purposes. -- Grant Edwards grant.b.edwards Yow! I was born in a at Hostess Cupcake factory gmail.com before the sexual revolution!