Spaces:
Sleeping
Sleeping
New service account
Browse files- .gitignore +1 -0
- autenticacion.py +2 -7
- conexion_firebase.py +3 -7
- globales.py +1 -1
.gitignore
CHANGED
@@ -2,3 +2,4 @@
|
|
2 |
/__pycache__/
|
3 |
bridges.py
|
4 |
config.json
|
|
|
|
2 |
/__pycache__/
|
3 |
bridges.py
|
4 |
config.json
|
5 |
+
config_old.json
|
autenticacion.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import os
|
2 |
import socket
|
3 |
-
|
4 |
import json
|
5 |
|
6 |
def obtenAccesoHF():
|
@@ -11,16 +11,11 @@ def obtenAccesoHF():
|
|
11 |
llave = bridges.llave
|
12 |
#Acceso a Firebase
|
13 |
# Use the application default credentials.
|
14 |
-
firebase_cred = credentials.Certificate('config.json')
|
15 |
else:
|
16 |
print("Estoy en entorno Remoto...")
|
17 |
#Acceso a HF
|
18 |
llave = os.getenv("llave")
|
19 |
-
|
20 |
-
firebase_cred = json.loads(configuracion_firebase)
|
21 |
-
print("182...")
|
22 |
-
print(firebase_cred)
|
23 |
-
return llave, firebase_cred
|
24 |
|
25 |
def local_check():
|
26 |
|
|
|
1 |
import os
|
2 |
import socket
|
3 |
+
|
4 |
import json
|
5 |
|
6 |
def obtenAccesoHF():
|
|
|
11 |
llave = bridges.llave
|
12 |
#Acceso a Firebase
|
13 |
# Use the application default credentials.
|
|
|
14 |
else:
|
15 |
print("Estoy en entorno Remoto...")
|
16 |
#Acceso a HF
|
17 |
llave = os.getenv("llave")
|
18 |
+
return llave
|
|
|
|
|
|
|
|
|
19 |
|
20 |
def local_check():
|
21 |
|
conexion_firebase.py
CHANGED
@@ -2,15 +2,11 @@ import firebase_admin
|
|
2 |
from firebase_admin import firestore
|
3 |
from firebase_admin import auth
|
4 |
import globales
|
|
|
5 |
|
6 |
-
print("Esto es globales, firebase cred:")
|
7 |
-
print(globales.firebase_cred)
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
}
|
12 |
-
|
13 |
-
firebase_admin.initialize_app(options=options)
|
14 |
|
15 |
db = firestore.client()
|
16 |
#dato es el dato que traes como el nombre del user.
|
|
|
2 |
from firebase_admin import firestore
|
3 |
from firebase_admin import auth
|
4 |
import globales
|
5 |
+
from firebase_admin import credentials
|
6 |
|
|
|
|
|
7 |
|
8 |
+
firebase_cred = credentials.Certificate('config.json')
|
9 |
+
firebase_admin.initialize_app(firebase_cred)
|
|
|
|
|
|
|
10 |
|
11 |
db = firestore.client()
|
12 |
#dato es el dato que traes como el nombre del user.
|
globales.py
CHANGED
@@ -2,7 +2,7 @@ import autenticacion
|
|
2 |
import herramientas
|
3 |
|
4 |
previo = "Una fotografía de un plato blanco con "
|
5 |
-
llave
|
6 |
|
7 |
espacio = "black-forest-labs/FLUX.1-schnell"
|
8 |
#espacio = "black-forest-labs/FLUX.1-dev"
|
|
|
2 |
import herramientas
|
3 |
|
4 |
previo = "Una fotografía de un plato blanco con "
|
5 |
+
llave = autenticacion.obtenAccesoHF()
|
6 |
|
7 |
espacio = "black-forest-labs/FLUX.1-schnell"
|
8 |
#espacio = "black-forest-labs/FLUX.1-dev"
|