You are invited to Log in or Register a free Frihost Account!

Help - My new python web script doesn't run

I have been asked yesterday by someone for help to get his python script running as he was running into an 500 Internal Server Error.
I was able to help via email but now think it is a good idea to post my ideas how to fix this here for anyone else who might run into this problem. Thus, here we go:

Exclamation Don't mess with .htaccess, just make sure your python script is executable.
Exclamation Look at an example: here is an example, my Python Expression Evaluator.
Exclamation Ensure you have #!/usr/bin/python at the beginning of your script
Exclamation I also suggest to give the script a try on a local computer first and check its syntax / compile it, see here for hints and tips how to do so.
Exclamation Ensure the Python modules you import are installed on Frihost. How to do this is described in my blog posting here.
Exclamation If nothing helps, check the error log in cpanel for any error messages from the script.

3 blog comments below

Hi. I was programming in python for quite sometime now and quite fond of Bottle Web Framework. I do have some issues. Can you point me in the right direction on how to deploy Bottle application in website using cgi. I did google it but no luck to find some frindlier instructions. Thank you.
jestoy0514 on Sat Oct 15, 2016 4:06 pm
I think you won't be able to install via pip as you would need a shell on Frihost and root authority. This can only be done by a system admin.
I tried the second approach to manually create and run it, but it throws an error at line 2309 in method load_module. Needs further investigation ...
amagard on Sun Oct 16, 2016 11:13 am
Thank you for the effort. I will be on standby just in case you have a good news.
jestoy0514 on Sun Oct 16, 2016 11:55 am

© 2005-2011 Frihost, forums powered by phpBB.