[Answered ]-Django request.user is empty

1👍

Django’s auth mechanism has nothing to do with Google’s or any other auth service. If you want to integrate third party auth service with your Django site, you should do it youself.

If you’re using oauth2 library, it’s README has a section named "Logging into Django w/ Twitter" may help you.

1👍

If you are using oauth api from google. To get the user you have to do something like this

from google.appengine.api import oauth

# ...
        try:
            # Get the db.User that represents the user on whose behalf the
            # consumer is making this request.
            user = oauth.get_current_user()

        except oauth.OAuthRequestError, e:
            # The request was not a valid OAuth request.
            # ...

Leave a comment