Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use console class #42

Open
avlsi opened this issue Mar 26, 2022 · 2 comments
Open

Unable to use console class #42

avlsi opened this issue Mar 26, 2022 · 2 comments

Comments

@avlsi
Copy link

avlsi commented Mar 26, 2022

kite = Zerodha() # credentials are passed
kite.login()
Able to see holdings, profile from kite.

console = Console(z=kite)
console.dashboard()

Error message - kiteconnect.exceptions.TokenException: Invalid or expired session.

@ssheikh098
Copy link

@avlsi it's because console class expects 'x-csrftoken' in header. so add below 2 lines in Console class

image

@avlsi
Copy link
Author

avlsi commented Jun 2, 2024

Thanks for the changes suggested. I am able to now get console till login
cons = Console(kite)
print("{}".format(cons.login()))
print("{}".format(cons.pnl_summary()))
However I am getting an error when accessing pnl_summary or anyother functions.
Error is as follows -
h['authorization'] = "enctoken {}".format(self.enc_token)
AttributeError: 'Console' object has no attribute 'enc_token'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants