A micro api client for writing scripts against the Facebook Graph API.
Other
325
stars
74
forks
source link
Given URL is not permitted 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 #27
I have used the following steps to configure the facebook app:
My project is in the smm/smm_app folder
installed django-allauth
Added the following bits to settings.py:
AUTHENTICATION_BACKENDS = (
Needed to login by username in Django admin, regardless of allauth
"django.contrib.auth.backends.ModelBackend",
# `allauth` specific authentication methods, such as login by e-mail
"allauth.account.auth_backends.AuthenticationBackend"
Add the following parameters to the database:
UPDATE django_site SET DOMAIN = '127.0.0.1:8000', name = 'SMM' WHERE id=1;
INSERT INTO socialaccount_socialapp (provider, name, secret, client_id, key)
VALUES ("facebook", "Facebook", "app-secret", "app-id-here", '');
INSERT INTO socialaccount_socialapp_sites (socialapp_id, site_id) VALUES (1,1);
Now when I click 'Facebook', I get the sign-in page. But after putting in the credentials and clicking login, I get this message:
"Given URL is not permitted 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."
I have used the following steps to configure the facebook app: My project is in the smm/smm_app folder
AUTHENTICATION_BACKENDS = (
Needed to login by username in Django admin, regardless of
allauth
)
TEMPLATE_CONTEXT_PROCESSORS = ( "django.core.context_processors.request", "django.contrib.auth.context_processors.auth", "allauth.account.context_processors.account", "allauth.socialaccount.context_processors.socialaccount", )
auth and allauth settings
LOGIN_REDIRECT_URL = '/' SOCIALACCOUNT_QUERY_EMAIL = True SOCIALACCOUNT_PROVIDERS = { 'facebook': { 'SCOPE': ['email', 'publish_stream'], 'METHOD': 'js_sdk' # instead of 'oauth2' } }
And to INSTALLED_APPS, we’ll add these:
'allauth', 'allauth.account', 'allauth.socialaccount', 'allauth.socialaccount.providers.facebook',
Now we have to add this to urls.py:
url(r'^accounts/', include('allauth.urls')),
And finally, we’ll create the database:
python manage.py syncdb
Create and configure a Facebook app
selected Web as the platform
url: http://127.0.0.1:8000/
Add the following parameters to the database: UPDATE django_site SET DOMAIN = '127.0.0.1:8000', name = 'SMM' WHERE id=1; INSERT INTO socialaccount_socialapp (provider, name, secret, client_id,
key
) VALUES ("facebook", "Facebook", "app-secret", "app-id-here", ''); INSERT INTO socialaccount_socialapp_sites (socialapp_id, site_id) VALUES (1,1);Now when I click 'Facebook', I get the sign-in page. But after putting in the credentials and clicking login, I get this message: "Given URL is not permitted 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."
Please help.