ShAnSantosh commited on
Commit
882a1ba
·
verified ·
1 Parent(s): c4d43d0

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +4 -1
src/streamlit_app.py CHANGED
@@ -138,10 +138,13 @@ import streamlit as st
138
  import pandas as pd
139
  import gspread
140
  from oauth2client.service_account import ServiceAccountCredentials
 
141
 
 
 
142
  # Google Sheets Setup
143
  scope = ["https://spreadsheets.google.com/feeds", "https://www.googleapis.com/auth/drive"]
144
- creds = ServiceAccountCredentials.from_json_keyfile_name("./test_app_1.json", scope)
145
  client = gspread.authorize(creds)
146
  #https://docs.google.com/spreadsheets/d/1t96-Y21Nuj4dSy1UM4xJOnG3mlfF0C_vtfKRrptzKQ8/edit?usp=sharing
147
  # Access the sheet
 
138
  import pandas as pd
139
  import gspread
140
  from oauth2client.service_account import ServiceAccountCredentials
141
+ ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
142
 
143
+ # Construct full path to app.json
144
+ CONFIG_PATH = os.path.join(ROOT_DIR, "test_app_1.json")
145
  # Google Sheets Setup
146
  scope = ["https://spreadsheets.google.com/feeds", "https://www.googleapis.com/auth/drive"]
147
+ creds = ServiceAccountCredentials.from_json_keyfile_name(CONFIG_PATH, scope)
148
  client = gspread.authorize(creds)
149
  #https://docs.google.com/spreadsheets/d/1t96-Y21Nuj4dSy1UM4xJOnG3mlfF0C_vtfKRrptzKQ8/edit?usp=sharing
150
  # Access the sheet