Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #73653 > unrolled thread
| Started by | dandrigo <laurent.celati@gmail.com> |
|---|---|
| First post | 2014-06-27 03:26 -0700 |
| Last post | 2014-06-27 03:26 -0700 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Execute a python script with CGI ? dandrigo <laurent.celati@gmail.com> - 2014-06-27 03:26 -0700
| From | dandrigo <laurent.celati@gmail.com> |
|---|---|
| Date | 2014-06-27 03:26 -0700 |
| Subject | Re: Execute a python script with CGI ? |
| Message-ID | <mailman.11278.1403864817.18130.python-list@python.org> |
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).
Up to now :
*i edited these following lines of my apache httpd.conf:
----------------------------------------------------------------------------------
DocumentRoot "C:\Program Files (x86)\Apache Software
Foundation\Apache2.2\cgi-bin"
<Directory "C:/Program Files (x86)/Apache Software
Foundation/Apache2.2/cgi-bin/">
AddHandler cgi-script .cgi .py
--------------------------------------------------------------------------------
*i created a htacess.txt and i pasted it into the file these following lines
:
--------------------------------------------------------------------------------
# Interprétation des fichiers .py avant envoi au serveur HTTP
AddHandler cgi-script .py
Options +ExecCGI
# Fichiers index.py : indexes repertoires
DirectoryIndex index.py
--------------------------------------------------------------------------------
* 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=utf-8")
print()
print("Hello World!")
--------------------------------------------------------------------------------
=> What do you think about my configuration? I have made a mistake? I do
have one more thing? How to test our CGI? our to ensure that my cgi works
well?
I would like enable GET pattern only (no POST pattern).
2/ On a 2nd time, i would like to do the same operation (for the same python
script web service/ GET pattern) but on our remote LINUX server.
=> What is the difference beetween windows and linux configuration? Could
you throw light for me?
Thanks.
Regards.
--
View this message in context: http://python.6.x6.nabble.com/Execute-a-python-script-with-CGI-tp5062183p5062268.html
Sent from the Python - python-list mailing list archive at Nabble.com.
Back to top | Article view | comp.lang.python
csiph-web