Home > other >  Django database security configuration problems
Django database security configuration problems

Time:09-19

I am new to django novice, there are many places do not understand, consult everybody your advice, thank you.

Django database configuration in Settings.
in the DATABASES section of py
 
The DATABASES={
"Default" : {
'ENGINE' : 'sql_server pyodbc',
'NAME' : 'dabaseName',
'USER' : 'userName',
'PASSWORD' : 'PASSWORD',
'HOST' : 'hostnaem',
'PORT', '1433',
'OPTIONS' : {
SQL Server Native Client 'driver' : '11.0',
},
}
}


I use MS SQL server, in a Windows environment, I would like to ask in the Settings. The database related set of database in the py how do online account/password encryption? Directly in the set is too dangerous.

I find descriptions of the MySQL query django related documents can be set related to another file
# Settings. Py
 
The DATABASES={
"Default" : {
'ENGINE' : 'the django. Db. Backends. Mysql,
'OPTIONS' : {
'read_default_file' : '/path/to/my CNF',
},
}
}


# my. CNF
 
[client]
The database NAME=
User=user
Password=password
Default - character - set=utf8


But such. Look at my account password is still clear in the CNF, there is the risk of information technology,
Excuse me django on the configuration of database have a distinguishing method of sensitive data encryption? Or what Ann sexual practices?

CodePudding user response:

Django default there is no such file reading configuration function directly from the outside, you can try the django environ - https://blog.csdn.net/handsomekang/article/details/78682575

There are 2 game:
1. The use of environment variables, this in pure docker play more
2. The use of distributed configuration center (for example, springconfig nacos), the play more in micro service system, heavy, big project etc
  • Related