Answers for "django.core.exceptions.ImproperlyConfigured: Application labels aren't unique, duplicates: auth"

0

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

# foo/apps.py
####
#The problem is that with the changes to apps in Django 1.7, apps are required to have a unique label.

#By default the app label is the package name, so if you've got a package with the same name as one of your app modules (foo in this case), you'll hit this error.

#The solution is to override the default label for your app, and force this config to be loaded by adding it to __init__.py.
####
from django.apps import AppConfig

class FooConfig(AppConfig):
    name = 'full.python.path.to.your.app.foo'
    label = 'my.foo'  # <-- this is the important line - change it to anything other than the default, which is the module name ('foo' in this case)
Posted by: Guest on November-01-2020

Code answers related to "django.core.exceptions.ImproperlyConfigured: Application labels aren't unique, duplicates: auth"

Python Answers by Framework

Browse Popular Code Answers by Language