"Writing Your First Django App, Part 2" error with makemigrations

Working through part 2 of the tutorial and am getting this error when entering python manage.py makemigrations polls

Traceback (most recent call last):
  File "C:\Python312\Nonconflictingname\mysite\manage.py", line 22, in <module>
    main()
  File "C:\Python312\Nonconflictingname\mysite\manage.py", line 18, in main  
    execute_from_command_line(sys.argv)
  File "C:\Python312\Lib\site-packages\django\core\management\__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "C:\Python312\Lib\site-packages\django\core\management\__init__.py", line 416, in execute
    django.setup()
  File "C:\Python312\Lib\site-packages\django\__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\Python312\Lib\site-packages\django\apps\registry.py", line 93, in populate
    raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: Application labels aren't unique, duplicates: polls
PS C:\Python312\Nonconflictingname\mysite> 

I suppose that you have 2 applications with name “polls” in your settings.py. Django complains about it.
Paste here your settings.py file.

Yes, that was it. I had an additional “polls” entry under installed apps in settings.py. Removing the duplicate fixed the error. Thanks!

1 Like