问题在于,随着Django 1.7中应用程序的更改,要求应用程序具有唯一标签。
默认情况下,应用程序标签为程序包名称,因此,如果你具有与你的应用程序模块之一相同名称的程序包(
foo在本例中),则会遇到此错误。
解决方案是覆盖应用程序的默认标签,并通过将其添加到来强制加载此配置
__init__.py。
# foo/apps.pyfrom django.apps import AppConfigclass 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)和
# foo/__init__.pydefault_app_config = 'full.python.path.to.your.app.foo.apps.FooConfig'



