【问题标题】:Error while switching the database from sqllite to postgre django将数据库从 sqlite 切换到 postgre django 时出错
【发布时间】:2020-07-10 11:38:31
【问题描述】:

我将文件 settings.py 中 DATABASE 变量的值更改为

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'postgres',
        'USER': 'postgres',
        'PASSWORD': 'password',
        'HOST': 'localhost',
        'PORT': "5432"

    }
}

但是现在在我运行 python manage.py migrate 之后我得到了错误

django.db.utils.ProgrammingError: column "name" of relation "django_content_type" does not exist

谁能告诉我这个错误是什么意思以及如何解决它

【问题讨论】:

    标签: python python-3.x django postgresql django-2.1


    【解决方案1】:

    我想通了。发生这种情况是因为我必须共享同名的数据库。如果你遇到同样的错误检查

    【讨论】:

      猜你喜欢
      • 2019-01-09
      • 2014-10-27
      • 1970-01-01
      • 1970-01-01
      • 2020-10-12
      • 2023-03-12
      • 2021-06-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多