I updated bottle to 0.10.9
now if I tried to print bottle.request.url I get
Traceback (most recent call last):
File "/Users/g/p/taotie/code/backend/REST/bottle.py", line 737, in
_handle
return route.call(**args)
File "/Users/g/p/taotie/code/backend/REST/bottle.py", line 1456, in
wrapper
rv = callback(*a, **ka)
File "/Users/g/p/taotie/code/backend/REST/oauth.py", line 80, in
wrapper
print bottle.request.url
File "/Users/g/p/taotie/code/backend/REST/bottle.py", line 1044, in
url
return self.urlparts.geturl()
File "/Users/g/p/taotie/code/backend/REST/bottle.py", line 155, in
__get__
key, storage = self.key, getattr(obj, self.attr)
AttributeError: 'LocalRequest' object has no attribute 'environ'
if I tried to print bottle.request.environ I get
File "/Users/g/p/taotie/code/backend/REST/bottle.py", line 737, in
_handle
return route.call(**args)
File "/Users/g/p/taotie/code/backend/REST/bottle.py", line 1456, in
wrapper
rv = callback(*a, **ka)
File "/Users/g/p/taotie/code/backend/REST/oauth.py", line 81, in
wrapper
print bottle.request.environ
AttributeError: 'LocalRequest' object has no attribute 'environ'
what is going on?
On Mar 26, 10:53 am,
m...@gsites.de wrote:
> > Hi all,
> > I have some basic question on how a decorator in the apply list can
> > get the current route information.
>
> > @route("/yo", apply=[basic_oauth])
> > def yo():
> > return "YO"
>
> > def basic_oauth(func):
> > """
> > handle the basic oauth case
> > """
> > def wrapper(*arg, **kargs):
> > print bottle.request.url
> > return func(**kargs)
> > return wrapper
>
> Your example looks perfectly fine. And works as expected on my machine.
>
> > the request.url returned ishttp://
127.0.0.1/without the yo in the