Skip to content

Commit

Permalink
Update app.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanGallardo authored May 2, 2024
1 parent 76cd766 commit 049b8e6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
login_manager.init_app(app)

# if using Atlas database uncomment next line!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! and comment out the next four lines
client = pymongo.MongoClient(os.getenv("MONGO_URI"))
#client = pymongo.MongoClient(os.getenv("MONGO_URI"))

#if using containerized instance of mongo uncomment next 4 lines else comment them out
#root_username = os.environ["MONGO_INITDB_ROOT_USERNAME"] #1
#root_password = os.environ["MONGO_INITDB_ROOT_PASSWORD"] #2
#uri = f"mongodb://{root_username}:{root_password}@mongodb:27017/db?authSource=admin" #3
#client = pymongo.MongoClient(uri) #4
root_username = os.environ["MONGO_INITDB_ROOT_USERNAME"] #1
root_password = os.environ["MONGO_INITDB_ROOT_PASSWORD"] #2
uri = f"mongodb://{root_username}:{root_password}@mongodb:27017/db?authSource=admin" #3
client = pymongo.MongoClient(uri) #4

db = client[os.getenv("MONGO_DBNAME")] # store a reference to the database

Expand Down

0 comments on commit 049b8e6

Please sign in to comment.