Search code examples
djangodjango-allauth

django allauth: remove social application


I had Facebook and Google set up as providers for signing into my website using django allauth.

I don't want to use Facebook SocialApp anymore so I deleted it via the admin console. I also removed it from my settings.py

I deleted Facebook SocialApp so why do I still get this error:

ImproperlyConfigured at /accounts/login/
No Facebook app configured: please add a SocialApp using the Django admin 

Which other files need to be edited so that my django allauth configuration knows that only google needs to be used in the list of provider?

My settings.py currently looks like this:

# Application definition

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.sites',
    'multicam',
    'avatar',
    'allauth',
    'allauth.account',
    'allauth.socialaccount',
    'allauth.socialaccount.providers.google',
    'last_seen',
)

SITE_ID = 1

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',
    'last_seen.middleware.LastSeenMiddleware',
)

ROOT_URLCONF = 'app.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',
            ],
        },
    },
]

AUTHENTICATION_BACKENDS = (

    'django.contrib.auth.backends.ModelBackend',
    'allauth.account.auth_backends.AuthenticationBackend',
)

I would really appreciate any help on getting my allauth configuration setup correctly. Thank you.


Solution

  • Actually if you are removing one of the providers, you will land up in so many problems.

    It all starts with the settings file, where you will have to delete each and avery mention of facebook app. After that you will have to delete facebook from the socialapps table.

    Now if any user had logged into the website with facebook, either you should delete them(unlikely) or you should modify them as their provider would still be referencing to the facebook app.

    Just keep in mind that you have to analyse the database tables and delete or modify each reference of the app you are deleting.