web applications - Making Python scripts work on MAMP -
i'm using mamp server testing out web pages. i'm new python. i'm able run script in python interpreter print hello world.
print "hello world!"
so used same line in file name test.py . how should run on web.
as new python, tried normal things, placing test.py in /htdocs/cgi-bin/ , trying open it. says forbidden page.
anyone please me making work. thanks
to cgi, recommend reading python cgi docs. @ minimum, need output content type , html tags:
print "content-type: text/html" print print "<html>" print "<head>" print "<title>example of python cgi script</title>" print "</head>" print "<body>" print "hello world!" print "</body>" print "</html>"
also, make sure web server software has permission execute script. should able use chown set ownership , chmod set permissions.
Comments
Post a Comment