Pregunta

In the standard django package that Google App Engine uses there is a tool for easily creating a login/logout link with this code:

user = users.get_current_user()
context = {
          'user':      user,
          'login':     users.create_login_url(self.request.uri),
          'logout':    users.create_logout_url(self.request.uri)
          }

My problem is that I want to make a mashup of some data using the logged in user's google analytics information. I'm sure that I can use the same login link to also request access to their analytics information, but I've not been able to figure out what I need to modify to do that.

What is it that I need to change to request that access?

¿Fue útil?

Solución

Unfortunately, if you are using the built in Users API you will have to request access to the user's analytics information using separately from the login to your app.

Alternatively you could use Google's OpenID+OAuth Hybrid protocol, but you will not be able to use the built in Users API. A good starting point for implementing this might be Nick Johnson's AEoid, plus the Python OAuth2 lib.

In either case, you'll access their analytics data using the gdata analytics API.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top