Spaces:
Runtime error
Runtime error
IsaacKerson
commited on
Commit
•
e153455
1
Parent(s):
a2b8df7
set up mongo connection
Browse files- app.py +12 -3
- requirements.txt +2 -0
app.py
CHANGED
@@ -1,4 +1,13 @@
|
|
1 |
import streamlit as st
|
2 |
-
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
+
import pymongo
|
3 |
+
|
4 |
+
|
5 |
+
cluster = "mongodb+srv://m001-student:test-run@sandbox.zqzg8.mongodb.net/sample_airbnb?retryWrites=true&w=majority"
|
6 |
+
client = pymongo.MongoClient(cluster, server_api=ServerApi('1'))
|
7 |
+
#db = client.test
|
8 |
+
|
9 |
+
st.title("With Pymongo")
|
10 |
+
|
11 |
+
#x = st.slider('Select a value')
|
12 |
+
#st.write(x, 'squared is', x * x)
|
13 |
+
st.write(client.list_database_names())
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
pymongo
|
2 |
+
dnspython
|