I’m pretty new to python. I’ve started to learn a few lesssons, and for now, I’m trying to deploy a simple webserver based on web.py. Can someone help me and give an answer to these two questions:
-
I installed the web.py in
/home/.../public_html/cgi-bin/lib/python/webcatalog.public_html– the catalog from which my website starts. So What should I write in python scripts in top?I mean, if I write just
import webthan script works fine only in/public_html/cgi-bin/lib/python/catalog. Can I put the script in a other catalog, can’t I? What should I write in import section in that case? -
According to webpy.org a simple “Hello world” web app look like:
import web urls = ( '/(.*)', 'hello' ) app = web.application(urls, globals()) class hello: def GET(self, name): if not name: name = 'World' return 'Hello, ' + name + '!' if __name__ == "__main__": app.run()
When i run it, webserver takes default port as 8080. How to change it to standard 80, that will make my website available by url http://website.com?
P.S. It seems to me that formatting doesn’t works fine on stackoverflow. Sorry for that.
for your second question: try to override run.