我使用self.render来呈现一个html模板,它依赖于通过def post()方法中的ajax从客户端接收的信息,如下所示:class aHandler(BaseHandler):
@tornado.web.authenticated
def post(self):
taskComp = json.loads(self.request.body)
if taskComp['type'] == 'edit':
if taskComp['taskType'] == 'task':
self.render(
"tasks.html",
user=self.current_user,
timestamp='',
projects='',
type='',
taskCount='',
resName='')
但是,这不会将用户重定向到html页面“tasks.html”。
不过,我在控制台中看到一个状态:[I 141215 16:00:55 web:1811] 200 GET /tasks (127.0.0.1)
其中'/tasks'是tasks.html的别名
为什么不重新定向?
或者,如何使用从ajax接收的数据重定向到tasks.html页面以及上述self.render请求中提供的所有参数?