Quellcode durchsuchen

Merge branch 'ding_dev' of Ding/AcidificationModel into master

Ding vor 3 Monaten
Ursprung
Commit
154c2c6c51
2 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. BIN
      api/SoilAcidification.db
  2. 2 2
      api/app/routes.py

BIN
api/SoilAcidification.db


+ 2 - 2
api/app/routes.py

@@ -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}")