Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,6 +27,18 @@ timeout = Timeout(100.0, connect=600.0)
|
|
| 27 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
| 28 |
logging.info("Application starting up")
|
| 29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
class ImageData(BaseModel):
|
| 31 |
sheetID: str
|
| 32 |
base64Image: str
|
|
|
|
| 27 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
| 28 |
logging.info("Application starting up")
|
| 29 |
|
| 30 |
+
def get_secret(secret_name):
|
| 31 |
+
secret_path = f"/app/secrets/{secret_name}.txt"
|
| 32 |
+
try:
|
| 33 |
+
with open(secret_path, 'r') as secret_file:
|
| 34 |
+
return secret_file.read().strip()
|
| 35 |
+
except FileNotFoundError:
|
| 36 |
+
raise Exception(f"Secret file for {secret_name} not found")
|
| 37 |
+
|
| 38 |
+
# Use the function to get your DEZGO_API_KEY
|
| 39 |
+
dezgo_api_key = get_secret('dezgo_api_key')
|
| 40 |
+
print("DEZGO_API_KEY:", dezgo_api_key)
|
| 41 |
+
|
| 42 |
class ImageData(BaseModel):
|
| 43 |
sheetID: str
|
| 44 |
base64Image: str
|