I can't seem to get the basics of routing working.
This is my code.
#!/usr/bin/env python
# Imports
import web
# Variable definition
urls = (
# '/(.*)', 'hello',
'/', 'hello',
'/bob', 'bob')
app = web.application(urls, globals())
# Main class
class hello:
def GET(self, name):
print ( "Name for class - " ),
print ( name )
http_response = "Hello, world!"
return http_response
class bob:
def GET(self, name):
http_response = "Hello, bob!"
return http_response
# Call web.py app
if __name__ == "__main__":
app.run()
This code gives me 'TypeError: GET() takes exactly 2 arguments (1 given)'
when I request any route. If I replace the URLS variable with a catchall,
this works as expected.
What am I missing ?
Thanks.
--
You received this message because you are subscribed to the Google Groups
"web.py" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/webpy.
For more options, visit https://groups.google.com/d/optout.