pennersr / django-allauth

Integrated set of Django applications addressing authentication, registration, account management as well as 3rd party (social) account authentication.
https://allauth.org
MIT License
9.6k stars 3.05k forks source link

How to retrieve the Facebook app ID #2416

Closed danihodovic closed 4 years ago

danihodovic commented 4 years ago

When using the Facebook python business SDK (https://github.com/facebook/facebook-python-business-sdk) it requires the App ID in API calls. Is it possible to retrieve this using allauth?

Here is the getting started example which requires the app ID: https://developers.facebook.com/docs/business-sdk/getting-started#python

import sys
sys.path.append('/opt/homebrew/lib/python2.7/site-packages') # Replace this with the place you installed facebookads using pip
sys.path.append('/opt/homebrew/lib/python2.7/site-packages/facebook_business-3.0.0-py2.7.egg-info') # same as above

from facebook_business.api import FacebookAdsApi
from facebook_business.adobjects.adaccount import AdAccount

my_app_id = '{app-id}'
my_app_secret = '{appsecret}'
my_access_token = '{access-token}'
FacebookAdsApi.init(my_app_id, my_app_secret, my_access_token)
my_account = AdAccount('act_{{adaccount-id}}')
campaigns = my_account.get_campaigns()
print(campaigns
pennersr commented 4 years ago

https://django-allauth.readthedocs.io/en/latest/faq.html#why-did-you-just-close-my-issue