If you do not want to save the password in a mysql database of settings in django

If that, you can write a configuration file, use 'OPTIONS' to import the configuration file in, so you will not publish your password on the database on the source to git. Django This is the recommended method.

The settings.py # 
DATABASES = { 
    'default': { 
        'ENGINE': 'django.db.backends.mysql', 
        'the OPTIONS': { 
        'read_default_file': '/path/to/my.cnf', can be absolute # path, the configuration file into the project, but when uploading to avoid git. 
     'init_command' : 'INNODB the SET default_storage_engine =' # django is also recommended, in some cases, such as the purchase of cloud database default when the engine needs with you inconsistent. , table creation and provinces with mysql console manually change dozens of hundreds of table engine.
  },
}} # my.cnf [Client] Database = NAME the User the USER = password = pASSWORD default-Character-the SET utf8 =

Guess you like

Origin www.cnblogs.com/worldinmyeyes/p/12109371.html