2012-04-06 34 views

回答

2

在成功提交表單後,將HTTPFound返回到您想要的位置。

from pyramid.httpexceptions import HTTPFound 

def form_received_here(request): 
    # do stuff here 
    return HTTPFound('http://example.com') 

這將返回一個狀態碼302具有報頭Location設置爲http://example.com

+0

啊謝謝,我使用HTTPFound,但位置= request.route_url('http ...')。 – 2012-04-08 21:09:49