planet+django makemigration 不起作用

planet+django makemigration does not work

我正在尝试在 python 3、django 1.9 上使用 django-planet。按照他们的 page 上的说明进行操作后,我在 python manage.py makemigrations:

之后收到以下错误

planet.Feed.site: (fields.E300) Field defines a relation with model 'Site', whic h is either not installed, or is abstract.

这里是 django-planet 的作者:)

由于您的问题,我注意到文档缺少一个步骤:您必须将 django.contrib.sites 添加到 settings.INSTALLED_APPS.

之后,请运行“pythonmanage.py迁移”,因为 Django 1.9 添加了一个迁移以使 Site.domain 字段唯一。

我还不能为 django-planet 发布 Django 1.9 兼容版本,因为 django-tagging 没有支持它的官方版本。但是您可以通过这种方式安装开发版本,并且您的 django-planet 安装将起作用:

pip install -e git+git@github.com:Fantomas42/django-tagging.git@6246a1f270031908fe66cacbf1fb7a377021c4fc#egg=django-tagging