How to get python connect to database example to work?
You have en example in your support center entitled "How to use Python to connect to a database" and I do not understand how to get the example python file within it to run. I have placed the .py file in the cgi-bin folder as directed.
In one spot, it is stated that
"When viewing this page in our browser, we see:
Database version : 5.0.92-community-log"
but I can't view it in my browser. In fact, for any file in the cgi-bin folder I get an internal server error when I navigate to it.
I hope I am correct in actually navigating to the .py file as it looks as though it is supposed to act like an html file based on the print statements at the bottom.
I have tried changing the file extension to .cgi as suggested by some help sites, but that has not helped either.
Any suggestions on how to make it so that browsers execute the .py file and interpret the printed results as html would be greatly appreciated.
Also it seems odd that the python file should go in the cgi-bin folder if it is supposed to act like an html page. Suppose you wanted the .py file to be your index file. Would it recognize it as one?
Thanks,
Eric
In one spot, it is stated that
"When viewing this page in our browser, we see:
Database version : 5.0.92-community-log"
but I can't view it in my browser. In fact, for any file in the cgi-bin folder I get an internal server error when I navigate to it.
I hope I am correct in actually navigating to the .py file as it looks as though it is supposed to act like an html file based on the print statements at the bottom.
I have tried changing the file extension to .cgi as suggested by some help sites, but that has not helped either.
Any suggestions on how to make it so that browsers execute the .py file and interpret the printed results as html would be greatly appreciated.
Also it seems odd that the python file should go in the cgi-bin folder if it is supposed to act like an html page. Suppose you wanted the .py file to be your index file. Would it recognize it as one?
Thanks,
Eric