Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '"""': 0.07; 'subject:form': 0.07; 'subject:missing': 0.07; 'sys': 0.07; 'typed': 0.09; 'python': 0.11; '"%s"': 0.16; '(modulo': 0.16; '-tkc': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'isnt': 0.16; 'subject:key': 0.16; 'wrote:': 0.18; 'example': 0.22; 'import': 0.22; 'print': 0.22; "shouldn't": 0.24; 'server.': 0.24; 'environment': 0.24; 'header:In-Reply-To:1': 0.27; 'said,': 0.30; 'cgi': 0.31; 'header,': 0.31; 'entirely': 0.33; 'skip:# 10': 0.33; 'something': 0.35; 'test': 0.35; 'but': 0.35; 'possible': 0.36; 'subject:?': 0.36; 'depends': 0.38; 'to:addr:python-list': 0.38; 'previous': 0.38; 'that,': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'simple': 0.61; "you're": 0.61; 'first': 0.61; 'off,': 0.84; 'plugins': 0.84; 'received:50.22': 0.84 Date: Wed, 25 Sep 2013 10:42:45 -0500 From: Tim Chase To: python-list@python.org Subject: Re: Referrer key missing form os.environ dictionary? In-Reply-To: References: <5242fb8d$0$30000$c3e8da3$5496439d@news.astraweb.com> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - boston.accountservergroup.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tim.thechases.com X-Get-Message-Sender-Via: boston.accountservergroup.com: none X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 49 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1380123660 news.xs4all.nl 15924 [2001:888:2000:d::a6]:50777 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:54749 On 2013-09-25 18:16, =CE=9D=CE=AF=CE=BA=CE=BF=CF=82 wrote: > how caom the http_referer thing works ok now but when i just print > all the key listing of .os.environ ket the http_referer key isnt > inside? Well, first off, it's entirely possible (based on reading that paragraph) that you typed something wrong. That said, it depends on whether you're looking in your local environment, or the CGI environment provided by the server. As a simple example of what the server-side has/puts in your environment, you can use this CGI script: #!/usr/bin/env python import cgitb; cgitb.enable() import cgi import os import sys print "Content-Type: text/html\n\n" print """ Test CGI
""" for k,v in sorted(os.environ.items()): print "
%s
" % cgi.escape(k) print "
%s
" % cgi.escape(v) print """
""" Note that, if you go directly to the page, you shouldn't have a refer[r]er header, while if you arrive at it from some previous page, you might (modulo the aforementioned chicanery that plugins can induce) -tkc