0

I tried to migrate django mysqlite database mysql database.but can't migrate sqlite to mysql. i tried all the solutions but no use.

My code

settings.py

DATABSES = {
     'default' :{
         'ENGINE' : 'django.db.backends.mysql',
         'NAME'  :'MasterQuote',
         'USER'  : 'root',
         'PASSWORD' : 'root',
         'HOST' : 'localhost',
         'PORT' : ''
     }
}

ERROR TRACEBACK:

Traceback (most recent call last):
  File "./manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.6/dist-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.6/dist-packages/django/core/management/__init__.py", line 365, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.6/dist-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.6/dist-packages/django/core/management/base.py", line 335, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python3.6/dist-packages/django/core/management/commands/migrate.py", line 79, in handle
    executor = MigrationExecutor(connection, self.migration_progress_callback)
  File "/usr/local/lib/python3.6/dist-packages/django/db/migrations/executor.py", line 18, in __init__
    self.loader = MigrationLoader(self.connection)
  File "/usr/local/lib/python3.6/dist-packages/django/db/migrations/loader.py", line 49, in __init__
    self.build_graph()
  File "/usr/local/lib/python3.6/dist-packages/django/db/migrations/loader.py", line 206, in build_graph
    self.applied_migrations = recorder.applied_migrations()
  File "/usr/local/lib/python3.6/dist-packages/django/db/migrations/recorder.py", line 61, in applied_migrations
    if self.has_table():
  File "/usr/local/lib/python3.6/dist-packages/django/db/migrations/recorder.py", line 44, in has_table
    return self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor())
  File "/usr/local/lib/python3.6/dist-packages/django/db/backends/base/base.py", line 255, in cursor
    return self._cursor()
  File "/usr/local/lib/python3.6/dist-packages/django/db/backends/dummy/base.py", line 20, in complain
    raise ImproperlyConfigured("settings.DATABASES is improperly configured. "
django.core.exceptions.ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details.

I tried all type of solution.I didn't add any data.my code was just initial stage

Anyone please help why this error was occurred ?

2 Answers 2

1

Try correcting the spelling of DATABASES, you have written DATABSES

Sign up to request clarification or add additional context in comments.

Comments

0

There is typo mistake in spelling of DATABASES.

Replace

DATABSES = {
     'default' :{
         'ENGINE' : 'django.db.backends.mysql',
         'NAME'  :'MasterQuote',
         'USER'  : 'root',
         'PASSWORD' : 'root',
         'HOST' : 'localhost',
         'PORT' : ''
     }
}

with

DATABASES = {
     'default' :{
         'ENGINE' : 'django.db.backends.mysql',
         'NAME'  :'MasterQuote',
         'USER'  : 'root',
         'PASSWORD' : 'root',
         'HOST' : 'localhost',
         'PORT' : ''
     }
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.