错误联系,
之前使用pycharm写的Django的时候,每当我更改玩setting的设置后,会出现错误如下,
/usr/bin/python /home/peggy/PycharmProjects/DDjango/NewRec/manage.py runserver 8000
Traceback (most recent call last):
File "/home/peggy/PycharmProjects/DDjango/NewRec/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/Django-1.7.3-py2.7.egg/django/core/management/__init__.py", line 385, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/Django-1.7.3-py2.7.egg/django/core/management/__init__.py", line 354, in execute
django.setup()
File "/usr/local/lib/python2.7/dist-packages/Django-1.7.3-py2.7.egg/django/__init__.py", line 21, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python2.7/dist-packages/Django-1.7.3-py2.7.egg/django/apps/registry.py", line 89, in populate
"duplicates: %s" % app_config.label)
django.core.exceptions.ImproperlyConfigured: Application labels aren't unique, duplicates: admin
解决方法
django内部已经包含一个 admin 的应用,你新建的app和系统的重名了,换个名字就好了。
发现在INSTALLED_APPS里面有两个admin,删掉一个可以了