|
@@ -33,7 +33,7 @@ def hash_password(password):
|
|
|
|
|
|
def get_db():
|
|
|
""" 获取数据库连接 """
|
|
|
- return sqlite3.connect(bp.config['DATABASE'])
|
|
|
+ return sqlite3.connect(current_app.config['DATABASE'])
|
|
|
|
|
|
|
|
|
# 添加一个新的辅助函数来检查数据集大小并触发训练
|
|
@@ -1178,7 +1178,7 @@ def import_data():
|
|
|
|
|
|
try:
|
|
|
# 保存文件到临时路径
|
|
|
- temp_path = os.path.join(bp.config['UPLOAD_FOLDER'], secure_filename(file.filename))
|
|
|
+ temp_path = os.path.join(current_app.config['UPLOAD_FOLDER'], secure_filename(file.filename))
|
|
|
file.save(temp_path)
|
|
|
logger.debug(f"File saved to temporary path: {temp_path}")
|
|
|
|