我正在尝试使用 django-easy-friends 应用程序为用户导入 facebook 好友列表。
在 facebook 应用程序设置中,我有
Site URL:http://localhost:8000/friends/suggestions/suggested_friends/
尝试导入好友列表时出现以下错误。
Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.
以下是 (friends/contrib/suggestions/backends) 中 importers.py 中的 facebook 导入类
class FacebookImporter(BaseImporter):
def get_contacts(self, credentials):
graph = facebook.GraphAPI(credentials["xxx"])
friends = graph.get_connections("me", "friends")
for friend in friends["data"]:
yield {
"name": friend["name"],
"email": "",
}