开发者

Can django-comments handle multiple comment forms on the page?

开发者 https://www.devze.com 2023-01-17 07:21 出处:网络
I have multiple models on a Django-powered webpage that have a django.contrib.comments form rendered for each.On this page, a post from one of these forms to /comments/post/ always res开发者_如何学编程

I have multiple models on a Django-powered webpage that have a django.contrib.comments form rendered for each. On this page, a post from one of these forms to /comments/post/ always res开发者_如何学编程ults in:

Forbidden (403)
CSRF verification failed. Request aborted.

If I include the same comment form code on another page where there is just one such form, it posts just fine.

Also fyi, I have included 'django.middleware.csrf.CsrfViewMiddleware' in the MIDDLEWARE_CLASSES and the {% csrf_token %} inside the comment form.

Any thoughts on this error or getting multiple django-comments forms on a page submitting correctly?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号