Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
import os
|
|
|
|
|
2 |
# os.system("pip install streamlit pandas xlsxwriter openpyxl pymongo matplotlib seaborn")
|
3 |
|
4 |
import streamlit as st
|
@@ -10,10 +12,15 @@ import hashlib
|
|
10 |
import matplotlib.pyplot as plt
|
11 |
import seaborn as sns
|
12 |
|
|
|
|
|
|
|
|
|
|
|
13 |
# MongoDB Setup
|
14 |
try:
|
15 |
from pymongo import MongoClient
|
16 |
-
client = MongoClient(
|
17 |
db = client['BTP_DB']
|
18 |
results_collection = db['protein_results']
|
19 |
except:
|
|
|
1 |
import os
|
2 |
+
from dotenv import load_dotenv
|
3 |
+
from pymongo import MongoClient
|
4 |
# os.system("pip install streamlit pandas xlsxwriter openpyxl pymongo matplotlib seaborn")
|
5 |
|
6 |
import streamlit as st
|
|
|
12 |
import matplotlib.pyplot as plt
|
13 |
import seaborn as sns
|
14 |
|
15 |
+
load_dotenv()
|
16 |
+
|
17 |
+
# Get MongoDB URI from environment
|
18 |
+
mongo_uri = os.environ.get("MONGODB_URI")
|
19 |
+
|
20 |
# MongoDB Setup
|
21 |
try:
|
22 |
from pymongo import MongoClient
|
23 |
+
client = MongoClient(mongo_uri)
|
24 |
db = client['BTP_DB']
|
25 |
results_collection = db['protein_results']
|
26 |
except:
|