Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -492,7 +492,7 @@ textarea.form-control{min-height:100px;font-family:monospace;resize:vertical;}
|
|
492 |
|
493 |
<script>
|
494 |
// Basic configuration
|
495 |
-
const cats = ${categories};
|
496 |
const tabs = document.getElementById('tabs');
|
497 |
const content = document.getElementById('content');
|
498 |
let active = "";
|
@@ -1098,10 +1098,17 @@ window.addEventListener('load', function() {
|
|
1098 |
# ────────────────────────── 8. MAIN ROUTES ──────────────────────────
|
1099 |
@app.route('/')
|
1100 |
def home():
|
1101 |
-
#
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1105 |
|
1106 |
# Initialize database on startup
|
1107 |
init_db()
|
|
|
492 |
|
493 |
<script>
|
494 |
// Basic configuration
|
495 |
+
const cats = "${categories}";
|
496 |
const tabs = document.getElementById('tabs');
|
497 |
const content = document.getElementById('content');
|
498 |
let active = "";
|
|
|
1098 |
# ────────────────────────── 8. MAIN ROUTES ──────────────────────────
|
1099 |
@app.route('/')
|
1100 |
def home():
|
1101 |
+
# 카테고리 목록을 JSON으로 변환
|
1102 |
+
categories_json = json.dumps(list(CATEGORIES.keys()))
|
1103 |
+
|
1104 |
+
# 디버깅을 위해 로그 추가
|
1105 |
+
logger.info(f"Categories: {list(CATEGORIES.keys())}")
|
1106 |
+
logger.info(f"Categories JSON: {categories_json}")
|
1107 |
+
|
1108 |
+
# 템플릿에 삽입할 때 추가 따옴표가 필요하지 않도록 수정
|
1109 |
+
html_content = HTML_TEMPLATE.replace('"${categories}"', categories_json)
|
1110 |
+
|
1111 |
+
return html_content
|
1112 |
|
1113 |
# Initialize database on startup
|
1114 |
init_db()
|