openfree commited on
Commit
7c2e16a
·
verified ·
1 Parent(s): 222fa2c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -5
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
- # HTML 템플릿에서 %% 대신 직접 % 문자를 사용
1102
- # categories 변수만 전달하고 나머지는 그대로 유지
1103
- template = HTML_TEMPLATE.replace('${categories}', json.dumps(list(CATEGORIES.keys())))
1104
- return template
 
 
 
 
 
 
 
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()