Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,6 +11,9 @@ import base64
|
|
| 11 |
from io import BytesIO
|
| 12 |
import requests
|
| 13 |
import json
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
# Directories
|
| 16 |
TEMP_DIR = "cloud_storage/temp"
|
|
@@ -20,6 +23,10 @@ os.makedirs(TEMP_DIR, exist_ok=True)
|
|
| 20 |
os.makedirs(PERM_DIR, exist_ok=True)
|
| 21 |
os.makedirs(THUMB_DIR, exist_ok=True)
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
# Sightengine API credentials (set as environment variables)
|
| 24 |
API_USER = os.getenv('SIGHTENGINE_API_USER')
|
| 25 |
API_SECRET = os.getenv('SIGHTENGINE_API_SECRET')
|
|
|
|
| 11 |
from io import BytesIO
|
| 12 |
import requests
|
| 13 |
import json
|
| 14 |
+
from dotenv import load_dotenv
|
| 15 |
+
import os
|
| 16 |
+
|
| 17 |
|
| 18 |
# Directories
|
| 19 |
TEMP_DIR = "cloud_storage/temp"
|
|
|
|
| 23 |
os.makedirs(PERM_DIR, exist_ok=True)
|
| 24 |
os.makedirs(THUMB_DIR, exist_ok=True)
|
| 25 |
|
| 26 |
+
|
| 27 |
+
# Load variables from .env file
|
| 28 |
+
load_dotenv()
|
| 29 |
+
|
| 30 |
# Sightengine API credentials (set as environment variables)
|
| 31 |
API_USER = os.getenv('SIGHTENGINE_API_USER')
|
| 32 |
API_SECRET = os.getenv('SIGHTENGINE_API_SECRET')
|