fix: Settings import

This commit is contained in:
kom-senapati
2024-10-22 17:58:41 +05:30
parent 5ba917c5e4
commit 3b76b3ddce
6 changed files with 7 additions and 7 deletions

View File

@@ -11,8 +11,8 @@ from bson.objectid import ObjectId
from flask import Blueprint, current_app, make_response, request, Response
from flask_restx import fields, Namespace, Resource
from core.mongo_db import MongoDB
from application.core.mongo_db import MongoDB
from application.core.settings import settings
from application.error import bad_request
from application.extensions import api

View File

@@ -1,10 +1,10 @@
import os
import datetime
from flask import Blueprint, request, send_from_directory
from core.mongo_db import MongoDB
from werkzeug.utils import secure_filename
from bson.objectid import ObjectId
from application.core.mongo_db import MongoDB
from application.core.settings import settings
mongo = MongoDB.get_client()

View File

@@ -8,11 +8,11 @@ from bson.dbref import DBRef
from bson.objectid import ObjectId
from flask import Blueprint, jsonify, make_response, request
from flask_restx import inputs, fields, Namespace, Resource
from core.mongo_db import MongoDB
from werkzeug.utils import secure_filename
from application.api.user.tasks import ingest, ingest_remote
from application.core.mongo_db import MongoDB
from application.core.settings import settings
from application.extensions import api
from application.utils import check_required_fields

View File

@@ -1,4 +1,4 @@
from application.core import settings
from application.core.settings import Settings
from pymongo import MongoClient
@@ -11,7 +11,7 @@ class MongoDB:
Get the MongoDB client instance, creating it if necessary.
"""
if cls._client is None:
cls._client = MongoClient(settings.MONGO_URI)
cls._client = MongoClient(Settings.MONGO_URI)
return cls._client
@classmethod

View File

@@ -1,6 +1,6 @@
import sys
from core.mongo_db import MongoDB
from datetime import datetime
from application.core.mongo_db import MongoDB
from application.utils import num_tokens_from_string
mongo = MongoDB.get_client()

View File

@@ -8,8 +8,8 @@ from urllib.parse import urljoin
import requests
from bson.objectid import ObjectId
from core.mongo_db import MongoDB
from application.core.mongo_db import MongoDB
from application.core.settings import settings
from application.parser.file.bulk import SimpleDirectoryReader
from application.parser.open_ai_func import call_openai_api