(图文无关,图片来自网络) 环境 IDE:JetBrains PyCharm 3.4.1 Python: 2.7.8 Django:1.7 MySQL:5.6.20 配置 数据库: #settings.py DATABASES = { ‘default’: { ‘ENGINE’: ‘django.db.backends.mysql’, ‘NAME’: ‘datebaseName’, ‘USER’: ‘username’, ‘PASSWORD’: ‘pass’, ‘HOST’: ‘127.0.0.1’, ‘PORT’: ‘3306’, } } 相关指令 python manage.py syncdb python manage.py makemigrations python manage.py migrate 参考文档 1.7