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__":

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 ?


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 webpy+unsubscr...@googlegroups.com.
To post to this group, send email to webpy@googlegroups.com.
Visit this group at https://groups.google.com/group/webpy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to