Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!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.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'postgresql': 0.07; 'http': 0.09; 'indexes': 0.09; 'subject:script': 0.09; 'python': 0.11; 'archive': 0.14; 'apache': 0.15; 'windows': 0.15; '.py': 0.16; '2.2,': 0.16; 'context:': 0.16; 'script,': 0.16; 'throw': 0.16; 'world!")': 0.16; 'subject:python': 0.16; 'subject: ?': 0.16; 'all,': 0.19; 'thanks.': 0.20; 'import': 0.22; 'script.': 0.24; 'server.': 0.24; 'options': 0.25; 'script': 0.25; 'post': 0.26; '(for': 0.26; 'header:In-Reply-To:1': 0.27; 'installed': 0.27; 'lines': 0.31; 'cgi': 0.31; 'coded': 0.31; 'file': 0.32; 'me?': 0.32; 'linux': 0.33; 'url:python': 0.33; 'could': 0.34; 'subject:with': 0.35; 'created': 0.35; 'test': 0.35; 'but': 0.35; 'list': 0.37; 'remote': 0.38; 'to:addr:python-list': 0.38; 'files': 0.38; 'to:addr:python.org': 0.39; 'mailing': 0.39; 'skip:p 20': 0.39; 'how': 0.40; 'ensure': 0.60; '2nd': 0.60; 'our': 0.64; 'more': 0.64; 'dear': 0.65; 'regards.': 0.65; '(web': 0.84; '2.7.': 0.84; 'avant': 0.91 Date: Fri, 27 Jun 2014 03:26:24 -0700 (PDT) From: dandrigo To: python-list@python.org In-Reply-To: <1403796296902-5062183.post@n6.nabble.com> References: <1403796296902-5062183.post@n6.nabble.com> Subject: Re: Execute a python script with CGI ? MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: 73 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1403864817 news.xs4all.nl 2947 [2001:888:2000:d::a6]:34765 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:73653 Dear all, 1/ On my windows 8, i installed apache 2.2, python 2.7. I coded a python script. I would like to execute this python script in CGI.= I would like enable GET pattern only (no POST pattern). =20 Up to now :=20 *i edited these following lines of my apache httpd.conf: ---------------------------------------------------------------------------= ------- DocumentRoot "C:\Program Files (x86)\Apache Software Foundation\Apache2.2\cgi-bin" AddHandler cgi-script .cgi .py ---------------------------------------------------------------------------= ----- =20 *i created a htacess.txt and i pasted it into the file these following line= s : ---------------------------------------------------------------------------= ----- # Interpr=C3=A9tation des fichiers .py avant envoi au serveur HTTP AddHandler cgi-script .py Options +ExecCGI # Fichiers index.py : indexes repertoires DirectoryIndex index.py ---------------------------------------------------------------------------= ----- =20 * Si i writed a python script (web service with postgresql query). At the begining of my script, i added these folloging lines : ---------------------------------------------------------------------------= ----- import cgitb cgitb.enable() print("Content-Type: text/html;charset=3Dutf-8") print() print("Hello World!") ---------------------------------------------------------------------------= ----- =3D> What do you think about my configuration? I have made =E2=80=8B=E2=80= =8Ba mistake? I do have one more thing? How to test our CGI? our to ensure that my cgi works well?=20 I would like enable GET pattern only (no POST pattern).=20 2/ On a 2nd time, i would like to do the same operation (for the same pytho= n script web service/ GET pattern) but on our remote LINUX server. =3D> What is the difference beetween windows and linux configuration? Could you throw light for me?=20 Thanks.=20 Regards.=20 -- View this message in context: http://python.6.x6.nabble.com/Execute-a-pytho= n-script-with-CGI-tp5062183p5062268.html Sent from the Python - python-list mailing list archive at Nabble.com.