(venv) C:\Users\vitor\PycharmProjects\intranet>python manage.py createsuperuser
Email: [email protected]
Password:
Password (again):
Ce mot de passe est trop court. Il doit contenir au minimum 8 caractères.
Ce mot de passe est trop courant.
Bypass password validation and create user anyway? [y/N]: y
Traceback (most recent call last):
File "C:\Users\vitor\PycharmProjects\intranet\venv\lib\site-packages\django\db\backends\utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
psycopg2.errors.ForeignKeyViolation: insert or update on table "core_user" violates foreign key constraint "core_user_category_id_8f8d84bc_fk_core_usercategory_id"
DETAIL: Key (category_id)=(1) is not present in table "core_usercategory".
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 21, in
main()
File "manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "C:\Users\vitor\PycharmProjects\intranet\venv\lib\site-packages\django\core\management_init_.py", line 381, in execute_from_command_line
utility.execute()
File "C:\Users\vitor\PycharmProjects\intranet\venv\lib\site-packages\django\core\management_init_.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\vitor\PycharmProjects\intranet\venv\lib\site-packages\django\core\management\base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\vitor\PycharmProjects\intranet\venv\lib\site-packages\django\contrib\auth\management\commands\createsuperuser.py", line 61, in execute
return super().execute(*args, **options)
File "C:\Users\vitor\PycharmProjects\intranet\venv\lib\site-packages\django\core\management\base.py", line 364, in execute
output = self.handle(*args, **options)
File "C:\Users\vitor\PycharmProjects\intranet\venv\lib\site-packages\django\contrib\auth\management\commands\createsuperuser.py", line 156, in handle
self.UserModel._default_manager.db_manager(database).create_superuser(**user_data)
File "C:\Users\vitor\PycharmProjects\intranet\core\managers.py", line 27, in create_superuser
user = self.create_user(email, password)
File "C:\Users\vitor\PycharmProjects\intranet\core\managers.py", line 19, in create_user
user.save(using=self._db)
File "C:\Users\vitor\PycharmProjects\intranet\venv\lib\site-packages\django\contrib\auth\base_user.py", line 66, in save
super().save(*args, **kwargs)
File "C:\Users\vitor\PycharmProjects\intranet\venv\lib\site-packages\django\db\models\base.py", line 741, in save
force_update=force_update, update_fields=update_fields)
File "C:\Users\vitor\PycharmProjects\intranet\venv\lib\site-packages\django\db\models\base.py", line 779, in save_base
force_update, using, update_fields,
File "C:\Users\vitor\PycharmProjects\intranet\venv\lib\site-packages\django\db\models\base.py", line 870, in _save_table
result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
File "C:\Users\vitor\PycharmProjects\intranet\venv\lib\site-packages\django\db\models\base.py", line 908, in _do_insert
using=using, raw=raw)
File "C:\Users\vitor\PycharmProjects\intranet\venv\lib\site-packages\django\db\models\manager.py", line 82, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "C:\Users\vitor\PycharmProjects\intranet\venv\lib\site-packages\django\db\models\query.py", line 1186, in _insert
return query.get_compiler(using=using).execute_sql(return_id)
File "C:\Users\vitor\PycharmProjects\intranet\venv\lib\site-packages\django\db\models\sql\compiler.py", line 1368, in execute_sql
cursor.execute(sql, params)
File "C:\Users\vitor\PycharmProjects\intranet\venv\lib\site-packages\django\db\backends\utils.py", line 99, in execute
return super().execute(sql, params)
File "C:\Users\vitor\PycharmProjects\intranet\venv\lib\site-packages\django\db\backends\utils.py", line 67, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "C:\Users\vitor\PycharmProjects\intranet\venv\lib\site-packages\django\db\backends\utils.py", line 76, in _execute_with_wrappers
return executor(sql, params, many, context)
File "C:\Users\vitor\PycharmProjects\intranet\venv\lib\site-packages\django\db\backends\utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "C:\Users\vitor\PycharmProjects\intranet\venv\lib\site-packages\django\db\utils.py", line 89, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "C:\Users\vitor\PycharmProjects\intranet\venv\lib\site-packages\django\db\backends\utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
django.db.utils.IntegrityError: insert or update on table "core_user" violates foreign key constraint "core_user_category_id_8f8d84bc_fk_core_usercategory_id"
DETAIL: Key (category_id)=(1) is not present in table "core_usercategory".