Django-jet: counters loading failed

Created on 20 Jul 2017  路  17Comments  路  Source: geex-arts/django-jet

hi,
i have created client secret and everything seems fine from google.
but, after granting the access, it cannot load counters.
What can i do for this?

Most helpful comment

In google_analytics.py
you need import threading
and:
class ModuleCredentialStorage(Storage):
def __init__(self, module):
self.module = module

  • self._lock = threading.Lock()

We resolve this, in: https://github.com/zodman/django-jet
https://github.com/zodman/django-jet/commit/02c5ad1c746b76185879a40fbc35185e590297e4
also we ask for the refresh tocken:
https://github.com/zodman/django-jet/commit/e25b8786d3a6c0a222b829737c7087eac696689b

All 17 comments

Okay guys, i got over this error it was due to the google console setting.
now it is working fine but after few hours it says api request failed.
And after revoking and again granting the permission, it works again.
I have placed the client_sectrets.json correctly.
Is there something i am missing?

@singhravi1 How did you solve this problem?

@SalahAdDin i had to enable the analytics api from google console. Did you read about the problem i am facing currently? after few hours it souws counter loading failed and i have to revoke and grant the access again.
Can you please suggest anything?

@SalahAdDin Can you please suggest anything?

@f1nality Hello.

@singhravi1 please come to my Discord server so we can organize if you like:

Welcome! 馃槃

serch!!!
how we fix the issue ?

@zodman first we need to get organized as a community, this repo is dead.

In google_analytics.py
you need import threading
and:
class ModuleCredentialStorage(Storage):
def __init__(self, module):
self.module = module

  • self._lock = threading.Lock()

We resolve this, in: https://github.com/zodman/django-jet
https://github.com/zodman/django-jet/commit/02c5ad1c746b76185879a40fbc35185e590297e4
also we ask for the refresh tocken:
https://github.com/zodman/django-jet/commit/e25b8786d3a6c0a222b829737c7087eac696689b

@SergioDzul thanks a lot man. it worked.
can you please explain the problem that was causing this?

After 2 or 3 hours the access token expire but we don't have the refresh tocken, so i ask for the that with "prompt = 'consent' ".
https://github.com/google/oauth2client/blob/a1da72d15c653c7bd5221211c9a2e7ce2e6341a5/oauth2client/client.py#L1830
prompt: A space-delimited, case-sensitive list of prompts to present the user. If you don't specify this parameter, the user will be prompted only the first time your app requests access. Possible values are none, consent, select_account.
https://developers.google.com/identity/protocols/OAuth2WebServer check the HTTP/REST
in step 2.

In the Storage Class need the self._lock attribute for refresh the access token.
The self._lock = lock is used in multiple methods by Class Storage:

https://github.com/google/oauth2client/blob/a1da72d15c653c7bd5221211c9a2e7ce2e6341a5/oauth2client/client.py#L336

Excellent dude. It was much needed patch.
Thanks again

@SergioDzul Can you make a PR to our repository?

@SergioDzul also please join us
https://discord.gg/EetgdK

RP #231 fix this issue!

Im still seeing this issue on the latest version is there a n=known fix for this.
having to revoke and grant all widgets isnt fun

@f1nality

Was this page helpful?
0 / 5 - 0 ratings

Related issues

VincentVW picture VincentVW  路  5Comments

ikresoft picture ikresoft  路  5Comments

PaoloC68 picture PaoloC68  路  7Comments

RamizSami picture RamizSami  路  4Comments

erayerdin picture erayerdin  路  5Comments