Created
March 14, 2019 11:43
-
-
Save tuchanemo/266ac478818973a4484141fdfcc24340 to your computer and use it in GitHub Desktop.
mysql django setting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.mysql', | |
'NAME': 'firstsql_db', | |
'USER': 'root', | |
'PASSWORD': '', | |
'HOST':'127.0.0.1', | |
'PORT':'3306', | |
'OPTIONS': { | |
'autocommit': True, | |
'init_command': "SET sql_mode='STRICT_TRANS_TABLES', innodb_strict_mode=1", | |
# Tell MySQLdb to connect with 'utf8mb4' character set | |
'charset': 'utf8mb4', | |
}, | |
# Tell Django to build the test database with the 'utf8mb4' character set | |
'TEST': { | |
'CHARSET': 'utf8mb4', | |
'COLLATION': 'utf8mb4_unicode_ci', | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment