CoolFace
Apppublic

SakshithBillava/My_app

sourceHugging Faceupdated 3y agoView on Hugging Face
0likes
database.py19 linesDownload Raw Back to root
1import pymongo2#import streamlit as st 3 4#@st.experimental_singleton  5#def init_connection():6#    return pymongo.MongoClient(**st.secrets["mongo"])7client = pymongo.MongoClient("mongodb+srv://sakshith2002:admin@cluster0.frpdmtc.mongodb.net/?retryWrites=true&w=majority")8 9db1 = client.Expenses10collections1 = db1.user_credentials11 12def addUser(username,name,password):13    if(len(username)!=0 and len(name)!=0 and len(password)!=0):14        item = {15            "names": name,16            "username": username,17            "password": password18        }19        collections1.insert_one(item)