В общем, попытался создать суперпользователя (и на винде, и на линуксе пробовал), однако sqlite мне выдал трейсбек:
(venv) D:\Education\Home\Python\pythonz\pythonz>py manage.py createsuperuser
Environment type: development
2019-07-30 23:00:18,057 DEBUG raven.contrib.django.client.DjangoClient: Configuring Raven for host: None
2019-07-30 23:00:18,057 INFO raven.contrib.django.client.DjangoClient: Raven is not configured (logging is disabled). Please see the documentation for more information.
Username: admin
Email address:
Password:
Password (again):
Error: Blank passwords aren't allowed.
Password:
Password (again):
Traceback (most recent call last):
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\db\backends\base\base.py", line 239, in _commit
return self.connection.commit()
sqlite3.IntegrityError: FOREIGN KEY constraint failed
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 17, in <module>
manage()
File "manage.py", line 13, in manage
execute_from_command_line(sys.argv)
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\core\management\__init__.py", line 371, in execute_from_command_line
utility.execute()
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\core\management\__init__.py", line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\core\management\base.py", line 288, in run_from_argv
self.execute(*args, **cmd_options)
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\contrib\auth\management\commands\createsuperuser.py", line 59, in execute
return super().execute(*args, **options)
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\core\management\base.py", line 335, in execute
output = self.handle(*args, **options)
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\contrib\auth\management\commands\createsuperuser.py", line 179, in handle
self.UserModel._default_manager.db_manager(database).create_superuser(**user_data)
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\contrib\auth\models.py", line 161, in create_superuser
return self._create_user(username, email, password, **extra_fields)
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\contrib\auth\models.py", line 144, in _create_user
user.save(using=self._db)
File "D:\Education\Home\Python\pythonz\pythonz\apps\generics\models.py", line 346, in save
super().save(*args, **kwargs)
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\contrib\auth\base_user.py", line 73, in save
super().save(*args, **kwargs)
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\db\models\base.py", line 729, in save
force_update=force_update, update_fields=update_fields)
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\db\models\base.py", line 759, in save_base
updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\db\transaction.py", line 212, in __exit__
connection.commit()
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\db\backends\base\base.py", line 261, in commit
self._commit()
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\db\backends\base\base.py", line 239, in _commit
return self.connection.commit()
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\db\utils.py", line 89, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\db\backends\base\base.py", line 239, in _commit
return self.connection.commit()
django.db.utils.IntegrityError: FOREIGN KEY constraint failed
(venv) D:\Education\Home\Python\pythonz\pythonz>py manage.py createsuperuser
Environment type: development
2019-07-30 22:46:34,805 DEBUG raven.contrib.django.client.DjangoClient: Configuring Raven for host: None
2019-07-30 22:46:34,806 INFO raven.contrib.django.client.DjangoClient: Raven is not configured (logging is disabled). Please see the documentation for more information.
Username: admin
Email address:
Password:
Password (again):
Traceback (most recent call last):
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\db\backends\base\base.py", line 239, in _commit
return self.connection.commit()
psycopg2.errors.ForeignKeyViolation: insert or update on table "apps_user" violates foreign key constraint "apps_user_submitter_id_d1ff9bb5_fk_apps_user_id"
DETAIL: Key (submitter_id)=(111) is not present in table "apps_user".
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 17, in <module>
manage()
File "manage.py", line 13, in manage
execute_from_command_line(sys.argv)
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\core\management\__init__.py", line 371, in execute_from_command_line
utility.execute()
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\core\management\__init__.py", line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\core\management\base.py", line 288, in run_from_argv
self.execute(*args, **cmd_options)
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\contrib\auth\management\commands\createsuperuser.py", line 59, in execute
return super().execute(*args, **options)
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\core\management\base.py", line 335, in execute
output = self.handle(*args, **options)
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\contrib\auth\management\commands\createsuperuser.py", line 179, in handle
self.UserModel._default_manager.db_manager(database).create_superuser(**user_data)
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\contrib\auth\models.py", line 161, in create_superuser
return self._create_user(username, email, password, **extra_fields)
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\contrib\auth\models.py", line 144, in _create_user
user.save(using=self._db)
File "D:\Education\Home\Python\pythonz\pythonz\apps\generics\models.py", line 346, in save
super().save(*args, **kwargs)
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\contrib\auth\base_user.py", line 73, in save
super().save(*args, **kwargs)
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\db\models\base.py", line 729, in save
force_update=force_update, update_fields=update_fields)
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\db\models\base.py", line 759, in save_base
updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\db\transaction.py", line 212, in __exit__
connection.commit()
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\db\backends\base\base.py", line 261, in commit
self._commit()
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\db\backends\base\base.py", line 239, in _commit
return self.connection.commit()
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\db\utils.py", line 89, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "D:\Education\Home\Python\pythonz\venv\lib\site-packages\django\db\backends\base\base.py", line 239, in _commit
return self.connection.commit()
django.db.utils.IntegrityError: insert or update on table "apps_user" violates foreign key constraint "apps_user_submitter_id_d1ff9bb5_fk_apps_user_id"
DETAIL: Key (submitter_id)=(111) is not present in table "apps_user".
Что-то с submitter_id походу.