Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
|
@@ -9,7 +9,14 @@ from openpyxl import load_workbook
|
|
| 9 |
from datetime import datetime
|
| 10 |
|
| 11 |
# ================== 配置 ==================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
DATABASE_ID = "2caee2cb9a5d8069a8b7c54113f266c1"
|
|
|
|
| 13 |
NOTION_TOKEN = os.environ.get("NOTION_TOKEN")
|
| 14 |
if not NOTION_TOKEN:
|
| 15 |
raise ValueError("NOTION_TOKEN not setup yet")
|
|
@@ -262,4 +269,8 @@ with gr.Blocks() as demo:
|
|
| 262 |
|
| 263 |
run_btn.click(run_statement, inputs=[customer_pick], outputs=[download, log_box])
|
| 264 |
|
| 265 |
-
demo.launch(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
from datetime import datetime
|
| 10 |
|
| 11 |
# ================== 配置 ==================
|
| 12 |
+
APP_USERNAME = os.environ.get("APP_USERNAME")
|
| 13 |
+
APP_PASSWORD = os.environ.get("APP_PASSWORD")
|
| 14 |
+
|
| 15 |
+
if not APP_USERNAME or not APP_PASSWORD:
|
| 16 |
+
raise ValueError("APP_USERNAME / APP_PASSWORD not set")
|
| 17 |
+
|
| 18 |
DATABASE_ID = "2caee2cb9a5d8069a8b7c54113f266c1"
|
| 19 |
+
|
| 20 |
NOTION_TOKEN = os.environ.get("NOTION_TOKEN")
|
| 21 |
if not NOTION_TOKEN:
|
| 22 |
raise ValueError("NOTION_TOKEN not setup yet")
|
|
|
|
| 269 |
|
| 270 |
run_btn.click(run_statement, inputs=[customer_pick], outputs=[download, log_box])
|
| 271 |
|
| 272 |
+
demo.launch(
|
| 273 |
+
auth=(APP_USERNAME, APP_PASSWORD),
|
| 274 |
+
auth_message="Please enter username and password"
|
| 275 |
+
)
|
| 276 |
+
|