Spaces:
Runtime error
Runtime error
Download tests/debug_uri.py from Darshankumarr03/Swift-Query: direct link, hf CLI and curl.
- Browser
- Download file 400 Bytes
-
https://huggingface.co/spaces/Darshankumarr03/Swift-Query/resolve/main/tests/debug_uri.py
- Command line
-
hf download hf://spaces/Darshankumarr03/Swift-Query/tests/debug_uri.py
-
curl -L -o debug_uri.py https://huggingface.co/spaces/Darshankumarr03/Swift-Query/resolve/main/tests/debug_uri.py
400 Bytes
| import os | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| uri = os.getenv("MONGO_URI") | |
| if uri: | |
| # Mask password | |
| if "@" in uri: | |
| prefix, suffix = uri.split("@", 1) | |
| # prefix contains user:pass | |
| print(f"URI Structure: {prefix.split('://')[0]}://<CREDENTIALS>@{suffix}") | |
| else: | |
| print(f"URI Structure: {uri}") | |
| else: | |
| print("MONGO_URI not found in environment.") | |