Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Application labels aren't unique, duplicates: account [duplicate]

I created an 'account' app in my project and I add to installed app and this code;

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.sites',

    'account',

    'allauth',
    'allauth.account',
    'allauth.socialaccount',
]

And, I run this project (python manage.py runserver), I have one problem:

django.core.exceptions.ImproperlyConfigured: Application labels aren't unique, duplicates: account

I not have seen before this problem and I don't have any idea.

like image 938
kerimdemirturk Avatar asked Sep 20 '25 11:09

kerimdemirturk


1 Answers

Specify a new app config--Django Doc in your account/apps.py file

# account/apps.py
from django.apps import AppConfig


class AccountConfig(AppConfig):
    name = 'account'
    label = 'any_unique_name'

and update your INSTALLED_APPS settings as,

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.sites',

    'account.apps.AccountConfig',  # change this

    'allauth',
    'allauth.account',
    'allauth.socialaccount',
]
like image 94
JPG Avatar answered Sep 22 '25 11:09

JPG