Created
April 20, 2017 22:37
-
-
Save nickretallack/a60e73c59659ad2926c7d726926f4159 to your computer and use it in GitHub Desktop.
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', | |
'HOST': 'localhost', | |
'NAME': 'db', | |
'USER': 'root', | |
'PASSWORD': '', | |
'OPTIONS': { | |
'charset': 'utf8mb4', | |
'init_command': 'set collation_connection=utf8mb4_unicode_ci', | |
}, | |
}, | |
} |
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
$ ./manage.py shell | |
>>> from django.db import connection | |
>>> cursor = connection.cursor() | |
>>> cursor.execute("show variables like 'collation_connection'") | |
>>> print cursor.fetchall() | |
((u'collation_connection', u'utf8mb4_general_ci'),) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment