Python web programming

From OriWiki

Jump to: navigation, search

python web tutorial

preparations

  • created a dedicated directory in the server
  • added a file named .htaccess which contains:
Options +ExecCGI
AddHandler cgi-script .py

Hello world

  • added a check.py file that contains:
#!/usr/bin/python
print "Content-Type: text/html"
print
print """\
<html>
<body>
<h2>Hello World!</h2>
</body>
</html>
"""
<source> 
(changed its permission to 755)
Personal tools