When I print “user_stream” in the development environment, the full string gets printed. However when I view what gets printed in the console in the production environment, the full contents of “user_stream” is not printed, which I believe is leading to an error later on in additional code I have.
My question is: why aren’t all the contents of “user_stream” being printed in the console in the production environment and how do I fix this?
instance = UserSocialAuth.objects.get(user=request.user, provider='facebook')
token = instance.tokens
user_url = "https://graph.facebook.com/me/friends?access_token=" + token['access_token']
u = urllib.urlopen(user_url);
user_stream = json.loads(u.read())
print user_stream
There is an error in your user_stream somehow. The best way to figure out what it is is to either print the string, or print the error message directly. These commands should help you figure out what is going on.
I strongly suspect that your access token isn’t valid somehow. Look into that as well. An example of what you might see from the Graph API Explorer is this:
Read the message there carefully, and see if you can figure out how to correct it. Also, try printing our your full URL and running it in the Graph API Explorer.