[Tutor] Question about python for web
Dat Huynh
htdatcse at gmail.com
Mon Jun 24 03:12:00 CEST 2013
Dear all,
I have a very simple question about running a simple web application with
apache on MacOS.
Step 1: Copy the file mod_wsgi.so from the link
http://code.google.com/p/modwsgi/downloads/detail?name=mod_wsgi-macosx106-ap22py26-3.3.so
into the folder "/usr/libexec/apache2"
Step 2: Add the following line:
LoadModule wsgi_module libexec/apache2/mod_wsgi.so
into the file "/etc/apache2/httpd.conf"
Step 3: Edit a file "test.py" as below and copy the file to the folder
"/Library/WebServer/Documents".
#!usr/bin/python
print "Content-type: text/html"
print
print "<html><head>"
print ""
print "</head><body>"
print "Test Page"
print "</body></html>"
When I type the following url "http://localhost/test.py" on my browser, I
see exactly the content of the file, NOT the text "Test Page" only.
I think I miss something in the procedure.
What should I do to make my browser process the received HTML data?
Thank you very much.
Sincerely,
Dat.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130624/a570cca1/attachment-0001.html>
More information about the Tutor
mailing list