Kevser 4 months ago
Back-end development
Django get database settings from file

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'OPTIONS': {
            'read_default_file': '.my.cnf',
        },
    }
}


.my.cnf file 
[client]
database = blog_data
user = djangouser
password = your_actual_password
default-character-set = utf8