Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

django allauth facebook local development

I'm using django-allauth for Facebook authentication in developement for a site and have set up accordingly:

within the facebook app settings on facebok:

Namespace: test_login
App Domains: blank
Site URL: http://127.0.0.1:8000/
Canvas URL: http://127.0.0.1:8000/
Secure Canvas URL: https://127.0.0.1:8000/

in Django admin I created new Social app:

Provider: Facebook
name: test_login
client_id: xxx
Secret: xxx
Sites: http://127.0.0.1:8000/

as you can see I added a new site http://127.0.0.1:8000/ instead of example.com.

The SITE_ID in the settings.py is the correct one.

So everything should be working, but it's not. After clicking to login through Facebook I get

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.

What am I missing? What isn't configured? As far as I can understand I should be able to use 127.0.0.1:8000 for testing.

like image 577
mislavcimpersak Avatar asked Jan 13 '23 09:01

mislavcimpersak


1 Answers

It worked for me setting the url in Facebook as localhost instead of 127.0.0.1. Also pass localhost:8000 to ./manage.py runserver

like image 50
leonaneves Avatar answered Jan 20 '23 15:01

leonaneves