Update .gitignore and add files.
This commit is contained in:
17
stockapp/config.py
Normal file
17
stockapp/config.py
Normal file
@ -0,0 +1,17 @@
|
||||
import logging
|
||||
|
||||
# MySQL 配置
|
||||
db_config = {
|
||||
'host': '172.18.0.2',
|
||||
'user': 'root',
|
||||
'password': 'mysqlpw',
|
||||
'database': 'stockdb'
|
||||
}
|
||||
|
||||
# 设置日志配置
|
||||
def setup_logging(log_filename):
|
||||
logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s [%(filename)s:%(lineno)d] - %(message)s',
|
||||
handlers=[
|
||||
logging.FileHandler(log_filename),
|
||||
logging.StreamHandler()
|
||||
])
|
||||
Reference in New Issue
Block a user