Django:评论发布后重定向到当前文章 [英] Django: Redirect to current article after comment post

查看:59
本文介绍了Django:评论发布后重定向到当前文章的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在项目中使用注释应用程序。

I am trying to use comments application in my project.

我尝试使用代码({%事件的%render_comment_form}),如此处的文档所示:
Django评论

I tried to use code ({% render_comment_form for event %}), shown in the documentation here: Django comments

问题是提交后如何使表单重定向到同一页面。

And the question is how to make the form redirect to the same page, after the submission.

另外一个大问题是:
当前,如果在for中发现任何错误,那么我们将重定向到预览模板。
可以避免这种现象并在同一表单(在同一页面上)上显示错误吗?

Also the big question is: Currently if we have any error found in the for, then we're redirected to preview template. Is that possible to avoid this behaviour and display errors over the same form (on the same page)?

推荐答案

简化Django的免费注释重定向

这篇关于Django:评论发布后重定向到当前文章的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆