mezzanine icon indicating copy to clipboard operation
mezzanine copied to clipboard

Mezzanine apps names can clash with project app names

Open iorlas opened this issue 8 years ago • 16 comments

As of Django 1.7, it is required to have unique app label. For example, we have mezzanine.core which app label is core. My project has core app too, so INSTALLED_APPS looks like:

(
    'core',
    'mezzanine.core'
    ...
)

Which leads to expected issue:

Traceback (most recent call last):
  File "./manage.py", line 17, in <module>
    main()
  File "./manage.py", line 14, in main
    execute_from_command_line(argv)
  File "/home/dtomilin/.virtualenvs/lc/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/home/dtomilin/.virtualenvs/lc/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 312, in execute
    django.setup()
  File "/home/dtomilin/.virtualenvs/lc/local/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/dtomilin/.virtualenvs/lc/local/lib/python2.7/site-packages/django/apps/registry.py", line 89, in populate
    "duplicates: %s" % app_config.label)
django.core.exceptions.ImproperlyConfigured: Application labels aren't unique, duplicates: core

So currently I can't install mezzanine on my project. It should be a good idea to create AppConfig for mezzanine apps, which will set labels with mezzanine. prefix. But it should break backward compat, migrations and some 3rd-party code.

And I can't just do this for my application because of same reasons. I gonna try to monkey-patch mezzanine.core AppConfig class, so I will be able to change app label, but I'm sure it will not that good in long term.

iorlas avatar Oct 26 '15 15:10 iorlas