DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'djangodb',
'USER': 'root',
'PASSWORD': '',
'HOST': '',
'PORT': '',
}
}
我創建了一個數據庫djangodb現在我 嘗試創建表 使用此命令mysql數據庫不工作的Django
./manage.py syncdb
我有望獲得
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
但我得到這個錯誤:
django.core.exceptions.ImproperlyConfigured: Error loading MySqldb module: no module named MySqldb
我甚至試着搭起一個主機127.0.0.1。任何人都可以弄清楚發生了什麼。