python - Any way to make dict passed to URL express in regexp in GAE? -



python - Any way to make dict passed to URL express in regexp in GAE? -

say, have dict

urls = {'admin' : '/admin/(.*)'}

and if so

application = ([ (r(urls['admin']), adminpage) ], debug=true)

google app engine raise error

nameerror: name 'r' not defined

i really need pass dictionary described in regexp url map making code more module.

what should create work?

thank help!

the 'r' string prefix escape sequences regular expression. not function. http://docs.python.org/reference/lexical_analysis.html#string-literals

urls = {'admin' : r'/admin/(.*)'} application = webapp.wsgiapplication([ (urls['admin'], adminpage) ], debug=true)

the "webapp.wsgiapplication" compile these strings regex itself.

python google-app-engine

Comments

Popular posts from this blog

java - How to pass parameters between Request-Scoped Controllers? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -