how to get current request's url in webpy

python, web.py

Solution

Just try printing `web.ctx` in your controller method and you will see a bunch of environmental variables.

from pprint import pprint
pprint(web.ctx)

So your url probably should be `ctx.home + ctx.path + ctx.query` or `ctx.home + ctx.fullpath`.

UPD: You may also take a look at `web.url` and `web.changequery`, find them in api docs: http://webpy.org/docs/0.3/api

Problem

I am using webpy framework. I want get current request's url in webpy. please help me, thanks.

Original source