title: How to solve django social auth error on Facebook?
body: <p>I installed <code>social-auth-app-django</code> and followed the guide <a href="https://simpleisbetterthancomplex.com/tutorial/2016/10/24/how-to-add-social-login-to-django.html" rel="nofollow noreferrer">here</a> to integrate Facebook login to django 1.8.18. The problem is when I go to "<a href="http://localhost:8000/social-auth/login/facebook/" rel="nofollow noreferrer">http://localhost:8000/social-auth/login/facebook/</a>" I get below error</p>
  
  <blockquote>
    <p>Can't Load URL: The domain of this URL isn't included in the app's domains. 
    To be able to load this URL, add all domains and subdomains of your 
        app to the App Domains field in your app settings.</p>
  </blockquote>
  
  <p>Here is my settings.py file</p>
  
  <pre class="lang-py prettyprint-override"><code># Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  import os
  
  BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  print (BASE_DIR)
  
  SECRET_KEY = 'x220#z=kwd)kjiu#u+p$)v0lu+rspyosg+)l*k$ux9j)1h'
  DEBUG = True
  
  ALLOWED_HOSTS = ['localhost']    
  INSTALLED_APPS = (
      ...
      'account',
      'social_django', #social classes
  )
  
  MIDDLEWARE_CLASSES = (
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.middleware.common.CommonMiddleware',
      'django.middleware.csrf.CsrfViewMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
      'django.middleware.clickjacking.XFrameOptionsMiddleware',
      'django.middleware.security.SecurityMiddleware',
       'social_django.middleware.SocialAuthExceptionMiddleware',
  )
  
  ROOT_URLCONF = 'bookmark.urls'
  
  TEMPLATES = [
      {
          'BACKEND': 'django.template.backends.django.DjangoTemplates',
          'DIRS': [os.path.join(BASE_DIR, 'templates')],
          'APP_DIRS': True,
          'OPTIONS': {
              'context_processors': [
                  'django.template.context_processors.debug',
                  'django.template.context_processors.request',
                  'django.contrib.auth.context_processors.auth',
                  'django.contrib.messages.context_processors.messages',
   'social_django.context_processors.backends',  # &lt;--
                  'social_django.context_processors.login_redirect', # &lt;--
              ],
          },
      },
  ]
  
  WSGI_APPLICATION = 'bookmark.wsgi.application'
  
  STATIC_URL = '/static/'
  MEDIA_URL = '/media/'
  MEDIA_ROOT = os.path.join(BASE_DIR,'media/')
  from django.core.urlresolvers import reverse_lazy
  LOGIN_REDIRECT_URL = reverse_lazy('dashboard')
  LOGIN_URL = reverse_lazy('login')
  LOGOUT_URL = reverse_lazy('logout')
  
  AUTHENTICATION_BACKENDS = (
      'social_core.backends.facebook.FacebookOAuth2',  #&lt; --facebook
  
      'django.contrib.auth.backends.ModelBackend',
      'account.authentication.EmailAuthBackend',
  )
  
  SOCIAL_AUTH_FACEBOOK_KEY='1742581762468139'
  SOCIAL_AUTH_FACEBOOK_SECRET='eae7dsfdsfdsf90b219becb84'
  </code></pre>
  
  <p>urls.py file</p>
  
  <pre class="lang-py prettyprint-override"><code>from django.conf.urls import include, url
  from django.contrib import admin
  from django.conf import settings
  from django.conf.urls.static import static
  
      urlpatterns = [
          url(r'^admin/', include(admin.site.urls)),
      url(r'^social-auth/',include('social_django.urls', namespace='social')), # &lt;-- social facebook
          url(r'^account/',include('account.urls')),
          url(r'^$','account.views.dashboard',name="dashboard"),
      ]
      if settings.DEBUG:
          urlpatterns += static(settings.MEDIA_ROOT,
                                document_root=settings.MEDIA_ROOT)
  </code></pre>
  
  <p>Here is Facebook developer-app settings details screenshot
  <a href="https://i.stack.imgur.com/7Qot5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7Qot5.png" alt="enter image description here"></a></p>
  
  <p>I also changed localhost to  something like "bookmarks.com" and changed it in /etc/hosts file but got same error <a href="https://i.stack.imgur.com/dXBJO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dXBJO.png" alt="error"></a></p>