This is my code:
import web
import json
urls = (
'/', 'index'
'/runs', 'runs'
)
app = web.application(urls, globals())
class index:
def GET(self):
render = web.template.render('templates/')
return render.index()
class runs:
def GET(self):
return "Test"
if __name__ == "__main__": app.run()
And I get the following error:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/web/application.py", line 239, in process
return self.handle()
File "/usr/local/lib/python2.7/dist-packages/web/application.py", line 230, in handle
return self._delegate(fn, self.fvars, args)
File "/usr/local/lib/python2.7/dist-packages/web/application.py", line 419, in _delegate
cls = fvars[f]
KeyError: u'index/runs'
Mostly people seem to forget to actually create the class (in my case runs) or fail at importing it if needed. I didn't find any other solution than checking these things.