0
DATABASES = {
'default': {
    'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
    'NAME': 'djangodb',             
    'USER': 'root',                 
    'PASSWORD': '',                 
    'HOST': '',                    
    'PORT': '',                      
} 
  }

I created a database djangodb now I tried creating tables with this command

./manage.py syncdb

I expected to get

Creating table auth_message
Creating table auth_group
Creating table auth_user
Creating table auth_permission
Creating table django_content_type
Creating table django_session
Creating table django_site
Creating table blog_blogpost

But I get this error:

django.core.exceptions.ImproperlyConfigured: Error loading  MySqldb module: no module named MySqldb

I have even tried putting up a host 127.0.0.1 .Can anyone figure out what happened.

2 Answers 2

3

Have you installed MySQL-python?

pip install mysql-python
Sign up to request clarification or add additional context in comments.

Comments

1

From the docs:

If you're using MySQL, you'll need the MySQL-python package, version 1.2.1p2 or higher. You will also want to read the database-specific notes for the MySQL backend.

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.