Skip to content

Commit

Permalink
[refine]允许 docker-compose.yml 定义密码而无须修改 setting.py
Browse files Browse the repository at this point in the history
  • Loading branch information
houbaron committed May 8, 2019
1 parent 5554832 commit f8d039e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Config/setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ class ConfigError(BaseException):
if DB_TYPE == 'SSDB':
DB_HOST = getenv('ssdb_host', '127.0.0.1')
DB_PORT = getenv('ssdb_port', '6379')
DB_PASSWORD = getenv('ssdb_password', '6379')
elif DB_TYPE == 'MONGODB':
DB_HOST = getenv('mongodb_host', '127.0.0.1')
DB_PORT = getenv('mongodb_host', '27017')
DB_PASSWORD = getenv('mongodb_password', '6379')
else:
raise ConfigError('Unknown database type, your environment variable `db_type` should be one of SSDB/MONGODB.')

Expand All @@ -36,7 +38,7 @@ class ConfigError(BaseException):
"HOST": DB_HOST,
"PORT": DB_PORT,
"NAME": "proxy",
"PASSWORD": ""
"PASSWORD": DB_PASSWORD

}
}
Expand Down

0 comments on commit f8d039e

Please sign in to comment.