• GoDaddy Community
  • VPS & Dedicated Servers
  • VPS & Dedicated Servers

    cancel
    Showing results for 
    Show  only  | Search instead for 
    Did you mean: 

    How to open sample python page

    Hi,

     

    I am trying to interact html with python. I know that php comes by default. Need similar setup done for accessing index.py

     

    My code:

    #!/usr/local/bin/python
    print "Content-type: text/html"
    import cgi
    print
    print '''<html>
    <head><title>My first Python CGI app</title></head>
    <body>
    <p>Hello, 'world'!</p>
    </body>
    </html>'''

     

    Error: I get 403 forbidden error. 

    You don't have permission to access / on this server.
    Server unable to read htaccess file, denying access to be safe

    Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

     

    Created .htaccess:

    Options +ExecCGI
    AddHandler cgi-script .py

     

    Still getting same error. Need assistance to this up.