-
-
Save loredonrj/49205064e1967a3dc6215691c7c5aa26 to your computer and use it in GitHub Desktop.
mysql django setting
This file contains hidden or 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