因此,我尝试在 Django 应用程序上运行初始迁移,当我尝试运行迁移命令(python manage.py migrate 或 makemigrations)时,出现以下错误:
psycopg2.ProgrammingError: relation "dotworks_server_internship" does not exist
LINE 1: ...s", "dotworks_server_internship"."questions" FROM "dotworks_...
^
我在使用 Django 1.9.6 的 Windows 环境中,我的数据库是 postgres。另外,我正在使用 PGAdmin 来管理我的数据库。
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'dotworks',
'USER': 'postgres',
'PASSWORD': 'mypasswordgoeshere',
'HOST': 'localhost',
'PORT': '5432',
}
}
最佳答案
我遇到了这个问题,我不得不注释掉 urls.py 中引用 views.py 的所有内容,然后运行 makemigrations。希望这会有所帮助。
关于python - Django 迁移关系不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40549437/