django comments

To get started using the comments app, follow these steps:

  1. Install the comments framework by adding 'django.contrib.comments' to INSTALLED_APPS.
  2. Run manage.py syncdb so that Django will create the comment tables.

  3. Add the comment app’s URLs to your project’s urls.py:
urlpatterns = patterns('',
    ...
    (r'^comments/', include('django.contrib.comments.urls')),
    ...
)

4.如果提交评论时发生如下错误:CSRF verification failed. Request aborted.

按如下方法解决即可

(1)在Settings.py里的MIDDLEWARE_CLASSES增加配置:(一般默认就有)
'django.middleware.csrf.CsrfViewMiddleware',

 
原文地址:https://www.cnblogs.com/s502/p/3129578.html