request_token = "4gP6CI2w**********IlLCc2" data = kite.generate_session(request_token, api_secret=api_secret)
kite.set_access_token(data["access_token"]) data = kite.generate_session(request_token,api_secret=api_secret) kite.set_access_token(data["access_token"])
it is showing these errrors- File "C:\Users\HP\PycharmProjects\pythonProject\pythonProject\main.py", line 13, in data = kite.generate_session(request_token, api_secret=key_secret[1]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\HP\PycharmProjects\pythonProject\pythonProject\venv\Lib\site-packages\kiteconnect\connect.py", line 263, in generate_session resp = self._post("api.token", params={ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\HP\PycharmProjects\pythonProject\pythonProject\venv\Lib\site-packages\kiteconnect\connect.py", line 865, in _post return self._request(route, "POST", url_args=url_args, params=params, is_json=is_json, query_params=query_params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\HP\PycharmProjects\pythonProject\pythonProject\venv\Lib\site-packages\kiteconnect\connect.py", line 937, in _request raise exp(data["message"], code=r.status_code) kiteconnect.exceptions.TokenException: Token is invalid or has expired.
I am new to python language.... Please help ! thankyou.
sir I have changed the code now it is showing this error: DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.kite.trade:443 DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "POST /session/token HTTP/1.1" 403 None
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.kite.trade:443
DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "POST /session/token HTTP/1.1" 403 None