4

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.

Dharman
  • 30,962
  • 25
  • 85
  • 135

1 Answers1

3

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',
]
JPG
  • 82,442
  • 19
  • 127
  • 206
  • its not working , same problem going on. – kerimdemirturk Dec 17 '19 at 16:47
  • Try to change the value of **`name`** attribute of **`AccountConfig`** class – JPG Dec 17 '19 at 16:50
  • 2
    the same error with me I can't understand what should I change 'account.apps.AccountConfig' to? also, what is the name that I have to write into a label please could you explain more about that? – Abdelhamed Abdin Jun 23 '20 at 19:45
  • Having the same issue. Changed the Installed apps and apps.py but not working – Hasidul Islam Oct 18 '22 at 11:27
  • It's quite late to say it but I think the issue would be: since you have two apps named account, one was in the base folder and the second was in the allauth folder. When you created the apps, both would have the same name in their respective `apps.py` so you needed to change the `name` in `allauth.account.apps.py` to allauth.account` to remove the respective error. @kerimdemirturk – Maisum Abbas Nov 29 '22 at 14:31