Get rid of the system default Sqlite3 database,
# Database
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
DATABASES = {
' Default ': {
# ' ENGINE ': ' Django.db.backends.sqlite3 ',
' ENGINE ': ' Django.db.backends.mysql ',
# ' NAME ': Os.path.join (Base_dir, ' db.sqlite3 '),
' NAME ': ' Djangodb ',
' USER ': ' Root ',
' PASSWORD ': ' 123456 ',
' Port ': ' 3306 ',
}
}
Then start the error,
Importerror:no module named ' MySQLdb '
It's said to be Mysql-python.
But Mysql-python has been unable to install successfully.
Also error Importerror:no module named ' Configparser '
Because Python3 is called configparser, it is lowercase.
Well, I heard no mysql-python can be replaced with pymsql, and then quickly download pip install Pymysql
Then start again, or not, or Importerror:no module named ' MySQLdb '
Baidu took the next, read this article http://www.jianshu.com/p/82781add8449
It's good to have it added.
Let's say Mysql-python here.
Mysql-python's explanation, look at the official statement.
MySQLdb is a interface to the popular MySQL database server for Python. The design goals are:
- Compliance with Python database API version 2.0 [PEP-0249]
- Thread-safety
- Thread-friendliness (threads won't block each other)
MySQL-3.23 through 5.5 and Python-2.4 through 2.7 are currently supported. Python-3.0 'll is supported in a future release. PyPy is supported.
It's a python interface that connects MySQL, and he can use Python to manipulate the database. Java-like JDBC that set of things.
Python3 using the Django framework to connect to MySQL (python3+django+mysql+pymysql)