Upgrade to django 1.7- ImproperlyConfigured -Tastypie label duplicate? help

448 views
Skip to first unread message

amarshall

unread,
Mar 29, 2015, 8:43:30 PM3/29/15
to django...@googlegroups.com
Hi,

 So I updated my django project from django 1.6 to 1.7.7 and when I run "python manage.py migrate" I get this error stating that I have a duplicate label.

Here's the traceback

  Creating tables...
 
Installing custom SQL...
 
Installing indexes...
Running migrations:
 
Applying tastypie.0001_initial...Traceback (most recent call last):
 
File "manage.py", line 11, in <module>
    execute_from_command_line
(sys.argv)
 
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility
.execute()
 
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 377, in execute
   
self.fetch_command(subcommand).run_from_argv(self.argv)
 
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 288, in run_from_argv
   
self.execute(*args, **options.__dict__)
 
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 338, in execute
    output
= self.handle(*args, **options)
 
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/migrate.py", line 161, in handle
    executor
.migrate(targets, plan, fake=options.get("fake", False))
 
File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/executor.py", line 68, in migrate
   
self.apply_migration(migration, fake=fake)
 
File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/executor.py", line 96, in apply_migration
   
if self.detect_soft_applied(migration):
 
File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/executor.py", line 140, in detect_soft_applied
    apps
= project_state.render()
 
File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/state.py", line 57, in render
   
self.apps = Apps([AppConfigStub(label) for label in sorted(self.real_apps + list(app_labels))])
 
File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 56, in __init__
   
self.populate(installed_apps)
 
File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 89, in populate
   
"duplicates: %s" % app_config.label)
django
.core.exceptions.ImproperlyConfigured: Application labels aren't unique, duplicates: tastypie


Not sure what to do here. I remove tastypie from the list of INSTALLED_APPS in my settings and everything works fine. but I do need it. Any suggestions ?

Filipe Ximenes

unread,
Mar 31, 2015, 5:52:55 AM3/31/15
to django...@googlegroups.com

Can you show us your INSTALED_APPS?
It may be the case you have a lot of apps installed and is not seeing a duplicate reference to tastypie.

--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7e4cfbf8-d3e0-4e0e-a38c-b83930ffa3b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

amarshall

unread,
Mar 31, 2015, 9:21:11 AM3/31/15
to django...@googlegroups.com
Hi Filipe,

I have few apps installed. When I comment out the tastypie line my app builds but gets an error in production because tastypie app isn't found. Here it is:

INSTALLED_APPS = (
   
'django.contrib.admin',
   
'django.contrib.auth',
   
'django.contrib.contenttypes',
   
'django.contrib.sessions',
   
'django.contrib.messages',
   
'django.contrib.staticfiles',
   
'rest_framework',
   
# 'south',       // commented out after upgrade to Django 1.7
   
'tastypie',
   
'lokal',        #my app
)

Filipe Ximenes

unread,
Mar 31, 2015, 10:34:23 AM3/31/15
to django...@googlegroups.com
Thats strange.
Are you using pip to install dependencies? Try uninstalling everything and reinstalling again. 
Make sure INSTALLED_APPS is not being defined somewhere else in the code. 
Does the error persists if you set DEBUG = False locally?


For more options, visit https://groups.google.com/d/optout.



--
  
Filipe Ximenes
+55 (81) 8245-9204
Vinta Software Studio
http://www.vinta.com.br

dc

unread,
May 30, 2015, 10:21:45 AM5/30/15
to django...@googlegroups.com
Were you able to solve the problem @amarshall? I have the exact same error, do let me know please!

amarshall

unread,
Jan 25, 2016, 8:16:03 AM1/25/16
to Django users
Been a while.I forgot if I solved it using that. However I did create different environments using env wrapper and do an uninstall of old django and complete install to the newest version. Fixing small errors as they arise.
Reply all
Reply to author
Forward
0 new messages