【发布时间】:2018-06-27 03:03:02
【问题描述】:
我创建了一个新的 django 项目,并在 settings.py 中添加了以下数据库设置
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'postgres',
'USER': 'postgres',
'PASSWORD': 'root',
'HOST': '127.0.0.1',
'PORT': '5432',
'OPTIONS':{'options': '-c search_path=resttest'}
}
}
我刚刚运行了“python manage.py migrate”
但是这个错误
django.db.utils.ProgrammingError: constraint "django_admin_log_user_id_c564eba6_fk" does not exist
当尝试使用默认 sqlite 或 MySQL 更改数据库设置时,它工作正常。
我什至尝试使用'ENGINE': 'django.db.backends.postgresql',如文档中所示。
谁能帮我猜猜是什么问题?
【问题讨论】:
标签: django postgresql migrate