Hi I don’t understand the error. Would you be able to help me.
I checked the mysql database the table users don’t exist.
python manage.py makemigrations
No changes detected
PS D:\mini project 2024\DonateItAll> python manage.py migrate
System check identified some issues:
WARNINGS:
?: (mysql.W002) MySQL Strict Mode is not set for database connection 'default'
HINT: MySQL's Strict Mode fixes many data integrity problems in MySQL, such as data truncation upon insertion, by escalating warnings into errors. It is strongly recommended you activate it. See: https://docs.djangoproject.com/en/4.1/ref/databases/#mysql-sql-mode
Operations to perform:
Apply all migrations: CareCollective, admin, auth, contenttypes, sessions
Running migrations:
Applying CareCollective.0001_initial...Traceback (most recent call last):
File "C:\Users\....\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\db\backends\utils.py", line 87, in _execute
return self.cursor.execute(sql)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\....\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\db\backends\mysql\base.py", line 75, in execute
return self.cursor.execute(query, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\....\AppData\Local\Programs\Python\Python311\Lib\site-packages\MySQLdb\cursors.py", line 179, in execute
res = self._query(mogrified_query)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\.....\AppData\Local\Programs\Python\Python311\Lib\site-packages\MySQLdb\cursors.py", line 330, in _query
db.query(q)
File "C:\Users\....\AppData\Local\Programs\Python\Python311\Lib\site-packages\MySQLdb\connections.py", line 255, in query
_mysql.connection.query(self, query)
MySQLdb.OperationalError: (1050, "Table 'users' already exists")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\mini project 2024\DonateItAll\manage.py", line 22, in <module>
main()
File "D:\mini project 2024\DonateItAll\manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "C:\Users\....\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\core\management\__init__.py", line 446, in execute_from_command_line
utility.execute()
File "C:\Users\....\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\core\management\__init__.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\....\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\core\management\base.py", line 402, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\....\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\core\management\base.py", line 448, in execute
output = self.handle(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\....\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\core\management\base.py", line 96, in wrapped
res = handle_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\....\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\core\management\commands\migrate.py", line 349, in handle
post_migrate_state = executor.migrate(
^^^^^^^^^^^^^^^^^
File "C:\Users\....\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\db\migrations\executor.py", line 135, in migrate
state = self._migrate_all_forwards(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\....\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\db\migrations\executor.py", line 167, in _migrate_all_forwards
state = self.apply_migration(
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\....\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\db\migrations\executor.py", line 252, in apply_migration
state = migration.apply(state, schema_editor)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\....\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\db\migrations\migration.py", line 130, in apply
operation.database_forwards(
File "C:\Users\....\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\db\migrations\operations\models.py", line 96, in database_forwards
schema_editor.create_model(model)
File "C:\Users\....\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\db\backends\base\schema.py", line 447, in create_model
self.execute(sql, params or None)
File "C:\Users\....\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\db\backends\base\schema.py", line 199, in execute
cursor.execute(sql, params)
File "C:\Users\....\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\db\backends\utils.py", line 102, in execute
return super().execute(sql, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\....\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\db\backends\utils.py", line 67, in execute
return self._execute_with_wrappers(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\....\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\db\backends\utils.py", line 80, in _execute_with_wrappers
return executor(sql, params, many, context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\....\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\db\backends\utils.py", line 84, in _execute
with self.db.wrap_database_errors:
File "C:\Users\....\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\db\utils.py", line 91, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "C:\Users\....\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\db\backends\utils.py", line 87, in _execute
return self.cursor.execute(sql)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\....\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\db\backends\mysql\base.py", line 75, in execute
return self.cursor.execute(query, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\....\AppData\Local\Programs\Python\Python311\Lib\site-packages\MySQLdb\cursors.py", line 179, in execute
res = self._query(mogrified_query)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\....\AppData\Local\Programs\Python\Python311\Lib\site-packages\MySQLdb\cursors.py", line 330, in _query
db.query(q)
File "C:\Users\....\AppData\Local\Programs\Python\Python311\Lib\site-packages\MySQLdb\connections.py", line 255, in query
_mysql.connection.query(self, query)
django.db.utils.OperationalError: (1050, "Table 'users' already exists")
PS D:\mini project 2024\DonateItAll>