James McCool
Initial commit and dockerization
711ca4e
raw
history blame contribute delete
437 Bytes
import streamlit as st
from pymongo import MongoClient
import os
@st.cache_resource
def init_conn():
uri = os.getenv('MONGO_URI')
if not uri:
uri = st.secrets['mongo_uri']
client = MongoClient(uri, retryWrites=True, serverSelectionTimeoutMS=100000)
dfs_db = client["NFL_Database"]
props_db = client["Props_DB"]
return props_db, dfs_db
# Initialize the database connection
props_db, dfs_db = init_conn()