Forums

Google API Auth

Hi all,

I am trying to use the Google API to access my Calendar https://developers.google.com/gmail/api/quickstart/python

This works great on my own machine, but when you first run it then a browser popup allows you authorise the connection. On PythonAnywhere this appears in the console but the final "Allow" links are disabled ("DISABLED form submit button").

Could anyone help with this? Any ideas how I can get the Google API to authorise?

Thanks

Tom

Is this while using Lynx in a PythonAnywhere console?

yeah that's using lynx. I think the button uses javascript so that's why it's disabled. The Google API auth is expecting a native app. I'll need to take a look at the google api docs for alternatives I think!

Hmm, one thing I just spotted while checking Stack Overflow for something unrelated was this post -- if I'm reading it correctly, you can do the auth stuff on your local machine, generate a credential file there, and then upload it to PythonAnywhere for use from our servers.

I haven't tried it, but it sounds like a plausible way forward...?

Just tried that and it worked like a charm. Thanks for that ;)

Hello,

using google calendar, how do i generate credentials files to upload into python anywhere for use?

im really confuse.

The best way to do that is to run your code on your own local machine to get it working -- it will bring up a browser tab where you can log in to Google and authorize it, and that will generate the credentials file. Then you can upload it to PythonAnywhere.

Yeah... but it is not working for me this solution.. :(

How is it failing?