0

I installed Django Facebook and I am using this method to post to a Page:

from open_facebook.api import OpenFacebook
graph = OpenFacebook("my_access_token")
graph.set('me/feed', message='hello world')

It's working on my local dev machine when I am logged in to my Facebook account. It stops working as soon as I sign out and I get this message:

OAuthException: Error validating access token: The session is invalid because the user logged out. (error code 190)

I got my access token from Graph API Explorer by passing /me/accounts

So the question, how do I make my code work on production when of course I'll not be logged in?

Please note that I'll only be posting to a Page that I own.

4

1 に答える 1

0

'me/feed'オフラインで使用したい場合;

アプリを認証し、投稿を呼び出すと、 APP アクセス トークンを使用できます。USER_ID/feed

: -user_idの代わりに使用するのは、ユーザーがセッション中で、ログアウト後にアクションを実行したい場合にのみ使用されます。meme


アプリのアクセス トークンを取得するには、

GET /oauth/access_token?
  client_id={app-id}
  &client_secret={app-secret}
  &grant_type=client_credentials
于 2013-09-10T09:49:59.327 に答える