2009/4/14 andrei <[email protected]>:
>
> Is there any way to make it to work like this
>
> urls = (
>    '(\d+)\.site\.com', 'page'
> )
> app = web.application(urls, globals())
>
>
> class page:
>    def GET(self, id):
>        return id
>
> if __name__ == "__main__":
>    app.run()

How about this?

urls = (
   ".*", "page"
)
app = web.application(urls, globals())

def get_site():
    return web.ctx.host.split(".")[0]

class page:
    def GET(self):
        return get_site()

if __name__ == "__main__":
    app.run()

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to