[MapProxy] Troubles try-ing wsgi samples

Andrea Peri aperi2007 at gmail.com
Thu Sep 28 00:40:46 PDT 2017


Hi,
I resolved,
removing wrong parameter "global_conf" from init def and adding the
"import random" that was missing.

Regards,
A.


2017-09-28 9:26 GMT+02:00 Andrea Peri <aperi2007 at gmail.com>:
> Hi,
> I'm try-ig to test the WSGI sample available in doc.
>
> But I'm having an error.
>
> The sample I try is this from mapproxy manual:
>
> ------------------------------------
> class RandomAuthFilter(object):
>     def __init__(self, app, global_conf):
>         self.app = app
>
>     def __call__(self, environ, start_response):
>         if random.randint(0, 1) == 1:
>           return self.app(environ, start_response)
>         else:
>           start_response('403 Forbidden',
>             [('content-type', 'text/plain')])
>           return ['no luck today']
>
> But the python report me this error:
>
>      application = RandomAuthFilter(application)
> [wsgi:error] [pid 7617:tid 139641698699008] [client
> 159.213.4.51:51711] TypeError: __init__() takes exactly 3 arguments (2
> given)
>
> Am I wrong something ?
> Thx,
> Andrea.
>
>
>
>
>
> --
> -----------------
> Andrea Peri
> . . . . . . . . .
> qwerty àèìòù
> -----------------



-- 
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------


More information about the MapProxy mailing list