django 2.0 tutorial :: exception:: application labels are not unique.

1,825 views
Skip to first unread message

Paolo Chilosi

unread,
May 15, 2018, 9:40:33 AM5/15/18
to Django users
As new to Django I am learning following the tutorial carefully. When I reached the point of making the migration for the polls app I executed (from the PyCharm terminal) the command:

(venv) C:\Users\Paolo\PycharmProjects\mysite>python manage.py makemigration polls

and then I obtained the following exception messages 

Traceback (most recent call last):
  File "manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "C:\Users\Paolo\PycharmProjects\mysite\venv\lib\site-packages\django\core\management\__ini
t__.py", line 371, in execute_from_command_line
    utility.execute()
  File "C:\Users\Paolo\PycharmProjects\mysite\venv\lib\site-packages\django\core\management\__ini
t__.py", line 347, in execute
    django.setup()
  File "C:\Users\Paolo\PycharmProjects\mysite\venv\lib\site-packages\django\__init__.py", line 24
, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\Users\Paolo\PycharmProjects\mysite\venv\lib\site-packages\django\apps\registry.py", line 93, in populate
    "duplicates: %s" % app_config.label)
django.core.exceptions.ImproperlyConfigured: Application labels aren't unique, duplicates: polls
(venv) C:\Users\Paolo\PycharmProjects\mysite>

I reviewed carefully the code and restarted the tutorial several times , all the times having the same problem.

ANY SUGGESTION?? thanks

Matthew Pava

unread,
May 15, 2018, 9:43:39 AM5/15/18
to django...@googlegroups.com

Though I’ve never seen that error, I’m guessing that maybe you added ‘polls’ to your INSTALLED_APPS setting more than once.  Simply remove the extra references to it.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/653a7dd7-b330-4062-86b2-3fa06598008a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sidyvan Fernandes de Andrade

unread,
May 15, 2018, 9:44:57 AM5/15/18
to django...@googlegroups.com
python manage.py makemigrations polls

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.

Paolo Chilosi

unread,
May 15, 2018, 10:24:59 AM5/15/18
to Django users
Mattew,
thank for the prompt answer. 
In effects, for some reason the app was preset 2 times in the INSTALLED_APPS list, also if I am sure I added it only once at the beginning of the list. Maybe django added it again at the end of the list. I will watch this behavior and let the list know.
Problem solved

To post to this group, send email to djang...@googlegroups.com.

Paolo Chilosi

unread,
May 15, 2018, 10:27:34 AM5/15/18
to Django users
thanks for pointing out about the typo. However this was not the cause of the exception. Look to my previous answer.
python manage.py makemigrations polls

To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

James Farris

unread,
May 15, 2018, 12:27:15 PM5/15/18
to django...@googlegroups.com
Just to note: Django doesn’t change the settings.py file, it only references it so it knows what configurations to load. 

Paolo Chilosi

unread,
May 16, 2018, 8:00:28 AM5/16/18
to Django users
just a note on your note: I created a few more new project/app using PyCharm create facility and I found the app registered in the INSTALLED_APPS settings. I do not know if it is Django or PyCharm that introduce this setting. In the first case the Django tutorial documentation should be amended. In any case from now I follow the protocol of inspecting the INSTALLED_APPS settings after the creation of a new project/app. 

Daniel Hepper

unread,
May 16, 2018, 8:27:51 AM5/16/18
to django...@googlegroups.com
That's definitely PyCharm, Django does not modify your settings file.

I'm a big fan of PyCharm myself, but when following the tutorial, I would suggest using its more advanced features and use like a plain text editor to avoid any confusion.



To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

subhani shaik

unread,
May 16, 2018, 10:17:19 AM5/16/18
to Django users
Hi..
How can i create grocery app.can you please share that data.

Melvyn Sopacua

unread,
May 21, 2018, 6:20:28 AM5/21/18
to django...@googlegroups.com
On woensdag 16 mei 2018 14:00:28 CEST Paolo Chilosi wrote:
> just a note on your note: I created a few more new project/app using
> PyCharm create facility and I found the app registered in the
> INSTALLED_APPS settings. I do not know if it is Django or PyCharm that
> introduce this setting.

It's you. Cause you filled in "polls" as the application name (not the project
name).

--
Melvyn Sopacua
Reply all
Reply to author
Forward
0 new messages