Search the Community
Showing results for tags 'Web.py'.
-
Hello I need to run a web app with web.py, Some other devices will Post and Get to the App and this last one needs to be able to reply to the caller with a json package, eventually this App will connect to the postgres database already in place here at heliohost. But I have encounter problems when trying to run the python script. and want to know if this is even possible to do here at Helioshost. Configuration: Server: jhonny Website: oswako.helioshost.org/cgi-bin/helloword.py File path: public_html/cgi-bin/helloworld.py File Permission: 755 Code: #!/usr/bin/env pythonimport psycopg2import webimport json print("Content-type: text/html\n\n") urls = ( '/', 'index', '/jsonp', 'jsonp') class index: def GET(self): return "Hello, world!" class jsonp: def POST(self): data = json.loads(web.data()) print data['ID'] print data['MAC'] web.header('Content-Type', 'application/json') return json.dumps(data) if __name__ == '__main__': app = web.application(urls,globals()) app.run() Note: The code has been verify on python and works fine on http://localhost:8080/ returning hello world. Error: when I try to run it in oswako.heliohost.org/cgi-bin/helloworld.py/ comes back with: Internal Server ErrorThe server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster@oswako.heliohost.org and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request. I have seem other forums from people trying to do something like this on helioshost but I can't find out if they were successful or not. thank you for your guidance and help in advanced. Oswaldo