developerDH commited on
Commit
fa47323
·
verified ·
1 Parent(s): a941268

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -37,6 +37,16 @@ from oauth2client.service_account import ServiceAccountCredentials
37
  import datetime
38
  import json
39
 
 
 
 
 
 
 
 
 
 
 
40
  # [1] 구글 시트 연결 설정 함수
41
  def get_google_sheet():
42
  # 1. 인증 범위 설정
 
37
  import datetime
38
  import json
39
 
40
+ key_content = os.environ.get("GSPREAD_KEY")
41
+
42
+ # 만약 Secret이 있다면, 즉석에서 'fashion_key.json' 파일을 만들어줌
43
+ if key_content:
44
+ with open("fashion_key.json", "w") as f:
45
+ f.write(key_content)
46
+ print("✅ 보안 키 파일 생성 완료!")
47
+ else:
48
+ print("⚠️ 경고: GSPREAD_KEY 환경변수가 없습니다. (로컬 실행이면 무시)")
49
+
50
  # [1] 구글 시트 연결 설정 함수
51
  def get_google_sheet():
52
  # 1. 인증 범위 설정