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
Post a Comment