Enabling python scripts to run in browser
Forgive me if this is obvious or basic - I have a domain and have done the 'setup python app' from Cpanel to create a new application in Cpanel. I have the setup as follows in the attached pic. called python_app_en
I also added the .py extension under Apache handlers
The public_html folder contains the files/folders as in the attached pic called public_html
The cgi-bin folder contains the files/folders as in the attached pic called cgi_bin
Now if I browser to this link in my domain, the browser displays:
It works!
Python v3.5.9
(which seems to be the index.py script being run)
But how do I run my own script in the browser, say the testing.py script? I tried placing it as part of the URL as :
-
What is output in the passenger log file when you attempt to access the URL with testing.py as well as /etc/apache2/logs/error_log0 -
HI, I don't see that logfile - my directory structure is as in the etc.jpg pic attached The only error file I found is error_log under: /public_ftp/public_html/error_log (and it's empty) It is possible that my (hosted) server does not allow python files to run in the browser. Where should I locate the .py file to run (in cgi-bin ?) browsing to: domain.co.za gives: Internal Server Error Here's the location of the testing.py file gives internal server error 0
Please sign in to leave a comment.
Comments
2 comments