Hello,
I am a beginner with webservers and gevent.
Using gevent with my web.py server prevents it from serving files located in /static, which it normally does by default.
I hacked it by adding a '/static/(.*)', 'static' path with a class getting the correct files.
Is there a way to keep that automatic? Maybe a parameter when building the WSGI server?
Thanks!
urls = (
'/', 'index',
'/static/(.*)', 'static' # I don't want that
)
class index:
def GET(self:
# the rendered index includes
<script type="text/javascript" src="/static/jquery.js"></script> return render.index()
class static:
deg GET(self, name):
return open('static/%s' % name)
if __name__ == "__main__":
# That works without the additional static url and class.
#web.application(urls,globals()).run()
# That does not work without the 'static' additional code.
application = web.application(urls, globals()).wsgifunc()
print 'Serving on 8080...'
WSGIServer(('localhost', 8080), application).serve_forever()