本文共 886 字,大约阅读时间需要 2 分钟。
参看
pip install django-contrib-comments
命令
- INSTALLED_APPS下添加
'django.contrib.sites'
- INSTALLED_APPS下添加
'django_comments'
- 定义SITE_ID ,
SITE_ID = 1
django-admin migrate
- 修改url.py添加comment app url
urlpatterns = [ ... url(r'^comments/', include('django_comments.urls')), ...]
python manage.py migrate
(blog) [root@localhost blog]# python manage.py migrateOperations to perform: Apply all migrations: admin, django_comments, blogpost, sessions, sites, auth, contenttypesRunning migrations: Rendering model states... DONE Applying sites.0001_initial... OK Applying django_comments.0001_initial... OK Applying django_comments.0002_update_user_email_field_length... OK Applying django_comments.0003_add_submit_date_index... OK Applying sites.0002_alter_domain_unique... OK
转载地址:http://qdjml.baihongyu.com/