Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -9,10 +9,14 @@ enable_btn = gr.Button.update(interactive=True)
|
|
9 |
|
10 |
import sqlite3
|
11 |
|
12 |
-
import
|
|
|
|
|
13 |
password=os.environ.get("MONGODB")
|
|
|
14 |
def init_database():
|
15 |
-
|
|
|
16 |
db = client["elo_ratings"]
|
17 |
collection = db["elo_ratings"]
|
18 |
return collection
|
|
|
9 |
|
10 |
import sqlite3
|
11 |
|
12 |
+
from pymongo.mongo_client import MongoClient
|
13 |
+
from pymongo.server_api import ServerApi
|
14 |
+
|
15 |
password=os.environ.get("MONGODB")
|
16 |
+
|
17 |
def init_database():
|
18 |
+
uri = f"mongodb+srv://new-user:{password}@cluster0.xb2urf6.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0"
|
19 |
+
client = MongoClient(uri, server_api=ServerApi('1'))
|
20 |
db = client["elo_ratings"]
|
21 |
collection = db["elo_ratings"]
|
22 |
return collection
|