To get started using the comments app, follow these steps:
- Install the comments framework by adding 'django.contrib.comments' to INSTALLED_APPS.
-
Run manage.py syncdb so that Django will create the comment tables.
- 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',