我对 Python 和 Django 完全陌生,但我需要在我的服务器上安装 testbedserver-software(我遵循本教程)。现在我在运行以下命令时遇到了麻烦:
python manage.py syncdb
显示以下错误:
CommandError: One or more models did not validate:
menu.bookmark: 'user' defines a relation with the model 'auth.User', which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL.
dashboard.dashboardpreferences: 'user' defines a relation with the model 'auth.User', which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL.
这是我的manage.py:
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "controller.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
这是我的settings.py:
from controller.settings_example import *
# Probably you want to override at least the database configuration:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'controller',
'USER': 'confine',
'PASSWORD': 'confine',
'HOST': 'localhost',
'PORT': '',
}
}
我已经找到了这个http://grokbase.com/p/gg/django-users/12ar0b12ca/ver-1-5-specifying-custom-user-model-extends-abstractuser-doesnt-work。但我什至不知道在哪里应用该解决方案。(我什至不知道这个问题是基于 PostgreSQL、Python 还是 Django...)
有人可以帮我弄这个吗?
在此先感谢,阿托比