django 添加comments app
生活随笔
收集整理的這篇文章主要介紹了
django 添加comments app
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
安裝和配置comments 1.安裝comments,運行:pip install django-contrib-comments命令
2.settings.py中做如下操作:
INSTALLED_APPS下添加'django.contrib.sites' INSTALLED_APPS下添加'django_comments' 定義SITE_ID , SITE_ID = 1 3.令comments app生效
django-admin migrate
4.配置url
修改url.py添加comment app url urlpatterns = [ ... url(r'^comments/', include('django_comments.urls')), ... ] 5.生成comments表
python manage.py migrate
(blog) [root@localhost blog]# python manage.py migrate
Operations to perform: Apply all migrations: admin, django_comments, blogpost, sessions, sites, auth, contenttypes Running 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://www.cnblogs.com/rwxwsblog/p/5718070.html,如需轉載請自行聯系原作者
2.settings.py中做如下操作:
INSTALLED_APPS下添加'django.contrib.sites' INSTALLED_APPS下添加'django_comments' 定義SITE_ID , SITE_ID = 1 3.令comments app生效
django-admin migrate
4.配置url
修改url.py添加comment app url urlpatterns = [ ... url(r'^comments/', include('django_comments.urls')), ... ] 5.生成comments表
python manage.py migrate
(blog) [root@localhost blog]# python manage.py migrate
Operations to perform: Apply all migrations: admin, django_comments, blogpost, sessions, sites, auth, contenttypes Running 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://www.cnblogs.com/rwxwsblog/p/5718070.html,如需轉載請自行聯系原作者
總結
以上是生活随笔為你收集整理的django 添加comments app的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: cisco dhcp vlan vrrp
- 下一篇: Linq to SQL Dynamic