我需要检索/
之后的任何字符串,并在下面的GetPost
类中检索该字符串。例如:/test123
,/blah
等在下面的应用程序应该去GetPost
类。正则表达式应用引擎
如何在下面的代码中实现上述要求?有我需要导入的任何模块吗?
class GetPost(webapp2.RequestHandler):
def get(self):
self.response.write("Permalink")
app = webapp2.WSGIApplication([
('/', HomePage),
('/new-post', NewPost),
('/create-post', CreatePost),
('/.+', GetPost)
], debug=True);
如果您要修复错误,请移除堆栈跟踪。 – bossylobster 2013-03-22 04:45:00