I am literally following the instructions on numerous documentations and online videos and this was working up until 2 days ago. Could someone point out if the fact that I've been moved up to Kiteconnect 3.0 is causing this trouble?
Codes are shown in the picture. I have erased my api key and secret even if there was not real need for that.
The first screen shot from you was showing the old login procedure. There are changes in the new system.
Login procedure from the new docs! #!python
# Redirect the user to the login url obtained # from kite.login_url(), and receive the request_token # from the registered redirect url after the login flow.
# Once you have the request_token, obtain the access_token # as follows.
data = kite.generate_session("request_token_here", api_secret="your_secret") kite.set_access_token(data["access_token"])
Sorry Manu, when started reading back on the discussion I didn't read the thread complete, the reason for above reply.
If your kiteconnect upgrade is proper when you write kite. and wait, the available attributes will be displayed. Check if generate_session is displayed.
@manuhegde Assuming you are getting `AttributeError: 'KiteConnect' object has no attribute 'generate_session'` and you have kiteconnect v3.7.0b9 in the sitepackages. Can you make sure the python shell uses the same pythonpath where the above packages are installed? Maybe you have multiple python installation.
@zartimus I did do that, so now 'request_access_token' doesnot work and generate_session kind of working. So progress - Yayy!
The issue is that it constantly says the token is invalid or expired. I will send screenshots of my misadventures. They are as follows
1) We look to generate login_url 2) Paste login url into chrome and get a request token 3) Successfully login (to Kite on Chrome web browser) 4) Use request token to try to get access token through generate_session(). I have also tried data=kite.generate_session(...)
From the screen shots, what you are selecting is not request_token, it is sess_id. sess_id may be session_id but not request_token. The address bar will change and contain request token if login is proper with redirect url in app.
Try it and check.
I am quite new to Python, so at this time I am fumbling along the best I can!
Any codes you can share will be greatly appreciated!
-Manu
pip install kiteconnect --upgrade --pre --user
I have stored my api key and api secret and and going to my kite.login_url()getting the access token and trying to run this:
kite.generate_session("loZgeGq6zFxSvQjMbF5XgdR3JA2Led4f",api_secret)
(Of course I keep changing the token as it changes each time)
My error is this:
https://github.com/zerodhatech/pykiteconnect/blob/kite3/examples/flask_app.py
will help you get the access token provided you have mentioned the redirect url correctly. (https://github.com/zerodhatech/pykiteconnect/blob/kite3/examples/flask_app.py#L40)
Sent a mail to [email protected] - hoping for the best.
https://kite.trade/forum/discussion/comment/13451/#Comment_13451 cannot happen if you have upgraded it.
Can you check your kiteconnect version again?
`pip show kiteconnect` Please post the output here
I have attached the outputs of the pip show commands
@zartimus : I did run that code and we do see Kiteconnect V3.7.0b9.
I have installed all the pre-requisites of this package too.
@pvgeorge : It appears we have service_identity 17.0.0
I checked for each pre-requirement here and all of them are installed too.
-Manu
Login procedure from the new docs!
#!python
# Redirect the user to the login url obtained
# from kite.login_url(), and receive the request_token
# from the registered redirect url after the login flow.
# Once you have the request_token, obtain the access_token
# as follows.
data = kite.generate_session("request_token_here", api_secret="your_secret")
kite.set_access_token(data["access_token"])
If your kiteconnect upgrade is proper when you write kite. and wait, the available attributes will be displayed. Check if generate_session is displayed.
So progress - Yayy!
The issue is that it constantly says the token is invalid or expired. I will send screenshots of my misadventures.
They are as follows
1) We look to generate login_url
2) Paste login url into chrome and get a request token
3) Successfully login (to Kite on Chrome web browser)
4) Use request token to try to get access token through generate_session().
I have also tried data=kite.generate_session(...)
https://kite.zerodha.com/dashboard
There are no more tokens to be copied!