sna*_*ile 2 django redirect comments
我正在使用Django的评论框架.每当有人发表评论时,他都会被重定向到成功页面(posted.html).我不希望成功页面显示出来.我只想重新加载当前页面(使用新的评论).如何停止重定向?
小智 5
添加名为隐藏的表单字段next是可行的方法,但您应该使用request.get_full_path因为request.path不包含查询字符串:
<input type="hidden" name="next" value="{{ request.get_full_path }}" />
Run Code Online (Sandbox Code Playgroud)