May-31-2018, 08:46 AM
I am working on a project where I am storing DB and users's credentials inside python code.
For example I have a script db.py which do crud operations and I am storing credential in this script as below-
I am using Python3.6,Mysql.
Can you please suggest me what will be the standard approach?
For example I have a script db.py which do crud operations and I am storing credential in this script as below-
credentials = {
"UAT": {
"host": 'UAT_HOST',
"port": UAT_PORT_Num,
"read_db": 'SCHEMA_1',
"write_db": 'SCHEMA_2',
"user": 'UAT_USER',
"password": 'UAT_PASSWORD'
},
"S3": {
"KEY": 'S3_KEY',
"SECRET": 'S3_SECRET_KEY'
}
}Similarly I have a script merchant.py where I am using credentials like-MERCHANT_ID = 1 STORE_ID = '1' CATEGORY_ID = 123 URL = 'http://example.com' environment = 'UAT'I need to move above credentials in a secure place but I don't have any idea how to do that.
I am using Python3.6,Mysql.
Can you please suggest me what will be the standard approach?
