on running python manage.py migrate arises this error, if I delete already existing table this command still show this type of error
Apply all migrations: admin, auth, bridge, contenttypes, sessions
Running migrations:
Applying contenttypes.0001_initial...Traceback (most recent call last):
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/django/db/backends/utils.py", line 83, in _execute
return self.cursor.execute(sql)
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/django/db/backends/mysql/base.py", line 71, in execute
return self.cursor.execute(query, args)
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/MySQLdb/cursors.py", line 250, in execute
self.errorhandler(self, exc, value)
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/MySQLdb/connections.py", line 50, in defaulterrorhandler
raise errorvalue
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/MySQLdb/cursors.py", line 247, in execute
res = self._query(query)
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/MySQLdb/cursors.py", line 411, in _query
rowcount = self._do_query(q)
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/MySQLdb/cursors.py", line 374, in _do_query
db.query(q)
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/MySQLdb/connections.py", line 277, in query
_mysql.connection.query(self, query)
_mysql_exceptions.OperationalError: (1050, "Table 'django_content_type' already exists")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
utility.execute()
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/django/core/management/__init__.py", line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/django/core/management/base.py", line 288, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/django/core/management/base.py", line 335, in execute
output = self.handle(*args, **options)
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/django/core/management/commands/migrate.py", line 200, in handle
fake_initial=fake_initial,
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/django/db/migrations/executor.py", line 117, in migrate
state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards
state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/django/db/migrations/executor.py", line 244, in apply_migration
state = migration.apply(state, schema_editor)
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/django/db/migrations/migration.py", line 122, in apply
operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/django/db/migrations/operations/models.py", line 92, in database_forwards
schema_editor.create_model(model)
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/django/db/backends/base/schema.py", line 314, in create_model
self.execute(sql, params or None)
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/django/db/backends/base/schema.py", line 133, in execute
cursor.execute(sql, params)
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/django/db/backends/utils.py", line 100, in execute
return super().execute(sql, params)
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/django/db/backends/utils.py", line 68, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/django/db/backends/utils.py", line 85, in _execute
return self.cursor.execute(sql, params)
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/django/db/utils.py", line 89, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/django/db/backends/utils.py", line 83, in _execute
return self.cursor.execute(sql)
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/django/db/backends/mysql/base.py", line 71, in execute
return self.cursor.execute(query, args)
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/MySQLdb/cursors.py", line 250, in execute
self.errorhandler(self, exc, value)
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/MySQLdb/connections.py", line 50, in defaulterrorhandler
raise errorvalue
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/MySQLdb/cursors.py", line 247, in execute
res = self._query(query)
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/MySQLdb/cursors.py", line 411, in _query
rowcount = self._do_query(q)
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/MySQLdb/cursors.py", line 374, in _do_query
db.query(q)
File "/usr/share/nginx/html/django_env/lib/python3.4/site-packages/MySQLdb/connections.py", line 277, in query
_mysql.connection.query(self, query)
django.db.utils.OperationalError: (1050, "Table 'django_content_type' already exists")