I recently began my work using web.py, but I’m stuck with a problem since web.py needs to have flup installed.
I downloaded flup from http://www.saddi.com (download Link) and then extracted it to a folder on my desktop.
I then navigate to the folder and run setup.py install. On success, I get an egg file in my C:\Python27\Lib\site-packages.
However, upon running the code below (taken from webpy.org):
#!/usr/bin/python
import web
urls = ("/.*", "hello")
app = web.application(urls, globals())
class hello:
def GET(self):
return 'Hello, world!'
web.wsgi.runwsgi = lambda func, addr=None: web.wsgi.runfcgi(func, addr)
if __name__ == "__main__":
app.run()
I get this error:
AttributeError: 'module' object has no
attribute 'fromfd'
Following this site‘s advice, I intended to change the contents of a file called fcgi_base.py. However this file is included in the said egg file. What I want to know is how do I change this Python file?
I think I can open the egg file with winrar and then edit the said file, but should I change it back to an egg file again to actually make it work?
Thank you for reading. Also, if you’ve had experience making web.py work, your advice would be much appreciated.
You need to specify the address and port that you’ve configured apache to forward to. For example, if you configured Apache’s FCGI to forward to 127.0.0.1:8080 you would do: