没有django_site这样的表 [英] No such table as django_site

查看:120
本文介绍了没有django_site这样的表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从 django-disqus 可以在我的项目中使用它。我已将其安装在设置中,并带有其他所需的设置( API密钥短名称)。但是,当我尝试运行以下命令时:

I am following from the docs of django-disqus to use it in my project. I have installed it in my settings, with other needed settings (API key and short name). But when I try to run these commands:

>>> from django.contrib.sites.models import Site
>>> Site.objects.all()

我遇到错误:


OperationalError:没有这样的表:django_site

OperationalError: no such table: django_site

我已经安装了 django.contrib.admin 并在我的项目中使用它。那我想念什么?

I have already installed django.contrib.admin in my settings and is using it in my project. So what am I missing?

推荐答案

请确保您已添加'django.contrib.sites' INSTALLED_APPS ,然后运行 migrate 创建所需的表。

Make sure you have added 'django.contrib.sites' to your INSTALLED_APPS, then run migrate to create the required table.

python manage.py migrate

这篇关于没有django_site这样的表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆