115π
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
.
# foo/apps.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)
and
# foo/__init__.py
default_app_config = 'full.python.path.to.your.app.foo.apps.FooConfig'
See https://docs.djangoproject.com/en/1.7/ref/applications/#for-application-authors
99π
I found simple solution for this. In my case following line is added twice under INSTALLED_APPS,
'django.contrib.foo',
Removed one line fixes the issue for me.
- [Django]-Readonly models in Django admin interface?
- [Django]-How do you perform Django database migrations when using Docker-Compose?
- [Django]-Best practices for adding .gitignore file for Python projects?
24π
I had the same error β try this:
In INSTALLED_APPS
, if you are including 'foo.apps.FooConfig'
, then Django already knows to include the foo app in the application, there is therefore no need to also include 'foo'
.
Having both 'foo'
and 'foo.apps.FooConfig'
under INSTALLED_APPS
could be the source of your problem.
- [Django]-How to format time in django-rest-framework's serializer?
- [Django]-How can I activate the unaccent extension on an already existing model
- [Django]-How can I find the union of two Django querysets?
15π
Well, I created a auth
app, and included it in INSTALLED_APP
like src.auth
(because itβs in src
folder) and got this error, because there is django.contrib.auth
app also. So I renamed it like authentication
and problem solved!
- [Django]-How to repeat a "block" in a django template
- [Django]-Manager isn't accessible via model instances
- [Django]-What is the easiest way to clear a database from the CLI with manage.py in Django?
6π
I got the same problem.
Here my app name was chat and in the settings.py , under installed apps i have written chat.apps.ChatConfig while i have already included the app name chat at the bottom. When i removed the chat.apps.ChatConfig mine problem was solved while migrations. This error may be due to the same instance that you might have defined you app name foo twice in the settings.py. I hope this works out!!
- [Django]-CSV new-line character seen in unquoted field error
- [Django]-What does 'many = True' do in Django Rest FrameWork?
- [Django]-Why does Django's render() function need the "request" argument?
- [Django]-Is it better to use path() or url() in urls.py for django 2.0?
- [Django]-How can I find the union of two Django querysets?
- [Django]-Pagination in Django-Rest-Framework using API-View
3π
As therefromhere said this is a new Django 1.7 feature which adds a kind of βapp registryβ where applications must be determined uniquely (and not only having different python paths).
The name
attribute is the python path (unique), but the label
also should be unique. For example if you have an app named βadminβ, then you have to define the name (name=βpython.pathβ) and a label which must be also unique (label=βmy adminβ or as said put the full python path which is always unique).
- [Django]-How to get the ID of a just created record in Django?
- [Django]-How can I activate the unaccent extension on an already existing model
- [Django]-ForeignKey to abstract class (generic relations)
3π
Had same issue, read through the settings.py of the root folder, removed any INSTALLED APPS causing conflict⦠works fine. Will have to rename the apps names
- [Django]-Django DB Settings 'Improperly Configured' Error
- [Django]-Retrieving a Foreign Key value with django-rest-framework serializers
- [Django]-Disable a method in a ViewSet, django-rest-framework
3π
This exception may also be raised if the name of the AppConfig class itself matches the name of another class in the project. For example:
class MessagesConfig(AppConfig):
name = 'mysite.messages'
and
class MessagesConfig(AppConfig):
name = 'django.contrib.messages'
will also clash even though the name attributes are different for each configuration.
- [Django]-Django.contrib.auth.logout in Django
- [Django]-IOS app with Django
- [Django]-Django β how to visualize signals and save overrides?
3π
In previous answer 'django.contrib.foo',
was mentioned, but basically adding any app twice can cause this error just delete one (Django 3.0)
for me it was in settings.py
INSTALLED_APPS = [
...
'accounts.apps.AccountsConfig',
'accounts.apps.AccountsConfig',
...
]
just delete one of them
- [Django]-Django β Clean permission table
- [Django]-Does SQLAlchemy have an equivalent of Django's get_or_create?
- [Django]-TypeError: data.forEach is not a function
3π
Basically this problem has been created due to duplication of name of installed app in the settings:
This is how I resolved the problem. In settings.py file:
-
Check the install app in the setting.py if the install app are duplicate
-
Error shown due to duplication of app name
-
Remove the duplicate name in the install file
-
After problem is resolved, you will see interface in your screen
For this I have created application name as polls instead of foo
- [Django]-Django File upload size limit
- [Django]-Django.db.utils.ProgrammingError: relation already exists
- [Django]-How do I add a placeholder on a CharField in Django?
2π
Need to check in two file
1- apps.py
code something like
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class ModuleConfig(AppConfig):
name = "ocb.module_name"
verbose_name = _("Module Name")
2 β init.py
code something like
default_app_config = "ocb.users.apps.ModuleConfig"
default_app_config is pointed to your apps.pyβs class name
- [Django]-Add Text on Image using PIL
- [Django]-Django get the static files URL in view
- [Django]-No module named pkg_resources
1π
in my case, in mysite settings.py , in INSTALLED_APPS array variable I put the name of the app twice by mistake.
- [Django]-Redirect to named url pattern directly from urls.py in django?
- [Django]-How to strip html/javascript from text input in django
- [Django]-Django: OperationalError No Such Table
1π
I had almost the same issue.
```File "/Users/apples/.local/share/virtualenvs/ecommerce-pOPGWC06/lib/python3.7/site-packages/django/apps/registry.py", line 95, in populate
"duplicates: %s" % app_config.label)
django.core.exceptions.ImproperlyConfigured: Application labels arenβt unique, duplicates: authβ`
I had installed Django.contrib.auth twice. I removed one and it worked well.
- [Django]-What's the best way to extend the User model in Django?
- [Django]-Where can I find the error logs of nginx, using FastCGI and Django?
- [Django]-Django index page best/most common practice
0π
From my experience, this exception was masking the real error. To see the real error (which in my case was an uninstalled python package) comment out the following in django/apps/registry.py:
if app_config.label in self.app_configs:
# raise ImproperlyConfigured(
# "Application labels aren't unique, "
# "duplicates: %s" % app_config.label)
pass
- [Django]-How do you dynamically hide form fields in Django?
- [Django]-How to submit form without refreshing page using Django, Ajax, jQuery?
- [Django]-How to use "get_or_create()" in Django?
0π
Check for duplicates in INSTALLED_APPS
inside the settings.pyβ¦If so remove one of it and rerun the command
- [Django]-How to update fields in a model without creating a new record in django?
- [Django]-Handle `post_save` signal in celery
- [Django]-Why does django run everything twice?
0π
I had Django==3.2.9
when tried to test my existing Django app on a new environment. I had this exact issue and fixed it by downgrading to Django==3.1.13
.
There seems to be an update to applications, check the Django 3.2 documentation for detailed information.
- [Django]-Django.contrib.gis.db.backends.postgis vs django.db.backends.postgresql_psycopg2
- [Django]-Django 2 β How to register a user using email confirmation and CBVs?
- [Django]-Django: add image in an ImageField from image url
0π
This error occurs because of duplication in your INSTALLED_APPS in settings.py file which is inside your project.
- [Django]-Django class-based view: How do I pass additional parameters to the as_view method?
- [Django]-Effects of changing Django's SECRET_KEY
- [Django]-How to do math in a Django template?
0π
For me, the problem was that I had copy-pasted entire app instead of creating it using command line. So, the app name in the apps.py file was same for 2 apps. After I corrected it, the problem was gone.
- [Django]-Error: could not determine PostgreSQL version from '10.3' β Django on Heroku
- [Django]-Django filter on the basis of text length
- [Django]-How to send email via Django?
0π
I was able to solve the same problem. As I understand it, this happened due to the fact that I performed an incorrect copy of the folder when creating static files. In general, try to find all duplicates in the code. Look in the urls
- [Django]-How to iterate through dictionary in a dictionary in django template?
- [Django]-How to allow users to change their own passwords in Django?
- [Django]-Where to put business logic in django
- [Django]-Unresolved attribute reference 'objects' for class '' in PyCharm
- [Django]-Django staticfiles not found on Heroku (with whitenoise)
- [Django]-How to override css in Django Admin?
-1π
In case if you have added your app name in settings.py
example as shown in figure than IN settings.py Remove it and Try this worked for me.
give it a try .
This Worked Because settings.py assumes installing it twice and does not allow for migration
- [Django]-Create a field whose value is a calculation of other fields' values
- [Django]-Using JSON in django template
- [Django]-Why is factory_boy superior to using the ORM directly in tests?