我正在尝试使用管理界面添加新用户并收到此错误:
/admin/main/customuser/add/ 处的 IntegrityError
������������:插入 ������ 更新 �� �������������� "django_admin_log" ���������� ������ ���������������������� ���������������� ������ ����“django_admin_log_user_id_fkey”详细信息:�������� (user_id)=(1) ���������������������� �� �� ������������“auth_user”。
这是回溯:
File "C:\Python33\lib\site-packages\django\core\handlers\base.py", line 115, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "C:\Python33\lib\site-packages\django\contrib\admin\options.py", line 372, in wrapper
return self.admin_site.admin_view(view)(*args, **kwargs)
File "C:\Python33\lib\site-packages\django\utils\decorators.py", line 91, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "C:\Python33\lib\site-packages\django\views\decorators\cache.py", line 89, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "C:\Python33\lib\site-packages\django\contrib\admin\sites.py", line 202, in inner
return view(request, *args, **kwargs)
File "C:\Python33\lib\site-packages\django\utils\decorators.py", line 25, in _wrapper
return bound_func(*args, **kwargs)
File "C:\Python33\lib\site-packages\django\utils\decorators.py", line 91, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "C:\Python33\lib\site-packages\django\utils\decorators.py", line 21, in bound_func
return func(self, *args2, **kwargs2)
File "C:\Python33\lib\site-packages\django\db\transaction.py", line 223, in inner
return func(*args, **kwargs)
File "C:\Python33\lib\site-packages\django\db\transaction.py", line 217, in __exit__
self.exiting(exc_value, self.using)
File "C:\Python33\lib\site-packages\django\db\transaction.py", line 281, in exiting
commit(using=using)
File "C:\Python33\lib\site-packages\django\db\transaction.py", line 152, in commit
connection.commit()
File "C:\Python33\lib\site-packages\django\db\backends\__init__.py", line 241, in commit
self._commit()
File "C:\Python33\lib\site-packages\django\db\backends\postgresql_psycopg2\base.py", line 242, in _commit
six.reraise(utils.IntegrityError, utils.IntegrityError(*tuple(e.args)), sys.exc_info()[2])
File "C:\Python33\lib\site-packages\django\utils\six.py", line 328, in reraise
raise value.with_traceback(tb)
File "C:\Python33\lib\site-packages\django\db\backends\postgresql_psycopg2\base.py", line 240, in _commit
return self.connection.commit()
我正在使用带有psycopg2的Postgres ,但无法理解问题出在哪里。在django方面,在Postgres或可能在psycopg2中?
另外,当我再次登录管理员时,响应用户已成功添加,但数据库表中没有新用户。