python - Error Migrating Comment Framework Into Django -
i trying use django's built-in comment framework project working on. according django documentation first 2 steps are:
- install comments framework adding
'django.contrib.comments'
installed_apps
- run
python manage.py migrate
django create comments tables.
so did , got following error
comments.comment.site: (fields.e300) field defines relation model 'site', either not installed, or abstract.
i don't know went wrong because did add 1 line installed_apps
, ran migrate
. appreciated.
try adding django.contrib.sites
in installed_apps
, set site_id=1
in settings.py
.
it's shown error:
field defines relation model 'site', either not installed, or abstract.
and migration file source code:
dependencies = [ ('sites', '0001_initial'), migrations.swappable_dependency(settings.auth_user_model), ('contenttypes', '0001_initial'), ]
it suggested django.contrib.sites
indeed dependency app.
edited:
in fact, included docs quick start guide:
enable "sites" framework adding 'django.contrib.sites'
installed_apps
, definingsite_id
.
Comments
Post a Comment