Spaces:
Runtime error
Runtime error
Download db.py from Pujan-Dev/testing_fastapi_with_mongodb: direct link, hf CLI and curl.
- Browser
- Download file 446 Bytes
-
https://huggingface.co/spaces/Pujan-Dev/testing_fastapi_with_mongodb/resolve/main/db.py
- Command line
-
hf download hf://spaces/Pujan-Dev/testing_fastapi_with_mongodb/db.py
-
curl -L -o db.py https://huggingface.co/spaces/Pujan-Dev/testing_fastapi_with_mongodb/resolve/main/db.py
446 Bytes
| from motor.motor_asyncio import AsyncIOMotorClient | |
| from urllib.parse import quote_plus | |
| username = "pujanneupaneop0907" | |
| password = "Pujan@1234" # your actual password | |
| password_encoded = quote_plus(password) | |
| MONGO_URI = f"mongodb+srv://{username}:{password_encoded}@cluster0.5kuhtss.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0" | |
| client = AsyncIOMotorClient(MONGO_URI) | |
| db = client["your_database_name"] # Replace with your DB name | |