Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -124,7 +124,7 @@ def detect_target_language(prompt):
|
|
124 |
firebase_config = {
|
125 |
"apiKey": os.environ["FIREBASE_API_KEY"],
|
126 |
"authDomain": os.environ["FIREBASE_AUTH_DOMAIN"],
|
127 |
-
"databaseURL": os.environ["FIREBASE_DATABASE_URL"],
|
128 |
"projectId": os.environ["FIREBASE_PROJECT_ID"],
|
129 |
"storageBucket": os.environ["FIREBASE_STORAGE_BUCKET"],
|
130 |
"messagingSenderId": os.environ["FIREBASE_MESSAGING_SENDER_ID"],
|
@@ -138,10 +138,10 @@ auth = firebase.auth()
|
|
138 |
def initialize_firebase():
|
139 |
try:
|
140 |
if not firebase_admin._apps:
|
141 |
-
cred_path = os.environ["
|
142 |
cred = credentials.Certificate(cred_path)
|
143 |
firebase_app = initialize_app(cred, {
|
144 |
-
'databaseURL': os.environ["
|
145 |
})
|
146 |
except Exception as e:
|
147 |
st.error(f"Firebase initialization error: {str(e)}")
|
|
|
124 |
firebase_config = {
|
125 |
"apiKey": os.environ["FIREBASE_API_KEY"],
|
126 |
"authDomain": os.environ["FIREBASE_AUTH_DOMAIN"],
|
127 |
+
"databaseURL": os.environ["FIREBASE_DATABASE_URL"], # Updated to match your variable
|
128 |
"projectId": os.environ["FIREBASE_PROJECT_ID"],
|
129 |
"storageBucket": os.environ["FIREBASE_STORAGE_BUCKET"],
|
130 |
"messagingSenderId": os.environ["FIREBASE_MESSAGING_SENDER_ID"],
|
|
|
138 |
def initialize_firebase():
|
139 |
try:
|
140 |
if not firebase_admin._apps:
|
141 |
+
cred_path = os.environ["FIREBASE_CREDS_JSON"] # example: "apna5.json"
|
142 |
cred = credentials.Certificate(cred_path)
|
143 |
firebase_app = initialize_app(cred, {
|
144 |
+
'databaseURL': os.environ["FIREBASE_DB_URL"]
|
145 |
})
|
146 |
except Exception as e:
|
147 |
st.error(f"Firebase initialization error: {str(e)}")
|