-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
33 lines (26 loc) 路 996 Bytes
/
Copy pathconfig.py
File metadata and controls
33 lines (26 loc) 路 996 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""
Configuration file for MongoDB connection
You can set environment variables or modify this file directly
"""
import os
from dotenv import load_dotenv
# Load environment variables from .env file if it exists
load_dotenv()
# MongoDB Configuration
# You can set these as environment variables or modify them here
MONGO_URI = os.getenv(
"MONGO_URI",
"mongodb+srv://Appliwaste_test:Software2025@dev-cluster.h3drl6b.mongodb.net/?retryWrites=true&w=majority&appName=dev-cluster"
)
DB_NAME = os.getenv("DB_NAME", "appliwaste")
# Alternative configurations for testing
LOCAL_MONGO_URI = "mongodb://localhost:27017/"
LOCAL_DB_NAME = "appliwaste_local"
# You can easily switch between configurations by changing this
USE_LOCAL = os.getenv("USE_LOCAL", "false").lower() == "true"
if USE_LOCAL:
MONGO_URI = LOCAL_MONGO_URI
DB_NAME = LOCAL_DB_NAME
print(f"馃敡 Using MongoDB URI: {MONGO_URI[:50]}...")
print(f"馃敡 Using Database: {DB_NAME}")
print(f"馃敡 Local mode: {USE_LOCAL}")