How can I work with sub domain in google app engine (python).

I wanna get first domain part and take some action (handler).

Example:
     product.example.com -> send it to products handler
     user.example.com -> send it to users handler

Actually, using virtual path I have this code:

  application = webapp.WSGIApplication(
    [('/', IndexHandler),
     ('/product/(.*)', ProductHandler),
     ('/user/(.*)', UserHandler)
  ]
Edit
Report