python - Getting post parameters with characters that are not allowed to be used in a variable with web.py -


i trying integrate google recaptcha site, when realized post parameter required submitted had character isn't legal "e.g. minus operator sign.

here code projects:

class apply:     def post(self):         = web.input()                  print recaptcha2.verify("mysecretkey",i.g-recaptcha-response, "end user's ip") 

the problem having relates g-recaptcha-response post parameter , how variable characters not legal use in variables python.

is there work-around this?

update: here example of error facing

traceback (most recent call last):   file "c:\python27\lib\site-packages\web\application.py", line 236, in process     return self.handle()   file "c:\python27\lib\site-packages\web\application.py", line 227, in handle     return self._delegate(fn, self.fvars, args)   file "c:\python27\lib\site-packages\web\application.py", line 409, in _delegat e     return handle_class(cls)   file "c:\python27\lib\site-packages\web\application.py", line 384, in handle_c lass     return tocall(*args)   file "c:\users\administrator\desktop\web app - copy\bin\app.py", line 42, in p ost     print recaptcha2.verify("mysecretkey", i.g-recaptcha-response, us_ip)   file "c:\python27\lib\site-packages\web\utils.py", line 76, in \__getattr__     raise attributeerror, k attributeerror: 'g'  myserverip - - [27/jun/2015 05:20:23] "http/1.1 post /apply_check" - 5 00 internal server error 

i able achieve getting post data sent g-recaptcha-response referencing in variable web.input() object e.g.

i = web.input() i['g-recaptcha-response'] 

Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -