DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'OPTIONS': { 'read_default_file': '/path/to/my.cnf', }, } }
[client] database = NAME user = USER password = PASSWORD default-character-set = utf8
settings.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'OPTIONS': {
'read_default_file': '/path/to/my.cnf',
},
}
}
my.cnf
[client]
database = NAME
user = USER
password = PASSWORD
default-character-set = utf8