Omkar008 commited on
Commit
05aa824
1 Parent(s): 0365945

Update test.py

Browse files
Files changed (1) hide show
  1. test.py +13 -5
test.py CHANGED
@@ -4,7 +4,7 @@ import requests
4
  from jose import jwt
5
  import webbrowser
6
  import base64
7
-
8
 
9
  app = FastAPI()
10
  oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
@@ -22,6 +22,10 @@ GOOGLE_CLIENT_ID = "485753721652-5uta3e18va2g6cnkldib2d68q39t4vod.apps.googleuse
22
  GOOGLE_CLIENT_SECRET = "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"
23
  GOOGLE_REDIRECT_URI = "https://omkar008-receipt-radar-test.hf.space/auth/google"
24
  GOOGLE_REDIRECT_URI_hr = "https://receiptradar-0bb387d81174.herokuapp.com/auth/google"
 
 
 
 
25
 
26
  @app.get("/")
27
  async def login_google():
@@ -159,12 +163,16 @@ async def test_websocket(websocket: WebSocket):
159
  # data = await request.json()
160
  # code = data.get("access_token")
161
  sucess =await websocket.accept()
162
- await print(sucess)
163
- await print("Hi hi working")
 
164
  # await websocket.send_json({"message":"Yes Websockets successfull"})
165
- await print("working after line 163")
 
 
166
  data = await websocket.receive_json()
167
- print(data)
 
168
  # code = data.get("message")
169
  # print(code)
170
  # code = raw_body.decode()
 
4
  from jose import jwt
5
  import webbrowser
6
  import base64
7
+ import logging
8
 
9
  app = FastAPI()
10
  oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
 
22
  GOOGLE_CLIENT_SECRET = "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"
23
  GOOGLE_REDIRECT_URI = "https://omkar008-receipt-radar-test.hf.space/auth/google"
24
  GOOGLE_REDIRECT_URI_hr = "https://receiptradar-0bb387d81174.herokuapp.com/auth/google"
25
+ # Configure the logger
26
+ logging.basicConfig(level=logging.DEBUG)
27
+ logger = logging.getLogger(__name__)
28
+
29
 
30
  @app.get("/")
31
  async def login_google():
 
163
  # data = await request.json()
164
  # code = data.get("access_token")
165
  sucess =await websocket.accept()
166
+ # await print(sucess)
167
+ # await print("Hi hi working")
168
+ logger.info("Hi hi succefull in connecting !!")
169
  # await websocket.send_json({"message":"Yes Websockets successfull"})
170
+ # await print("working after line 163")
171
+ logger.info("Now receiving json!!")
172
+
173
  data = await websocket.receive_json()
174
+ logger.info("Received JSON data: %s", data)
175
+ # print(data)
176
  # code = data.get("message")
177
  # print(code)
178
  # code = raw_body.decode()