Apps with name conflict (same tables)

47 views
Skip to first unread message

witt...@gmail.com

unread,
Nov 4, 2014, 12:53:51 PM11/4/14
to south...@googlegroups.com
Hi everybody,
I'm currently working on a Mezzanine site and I try to integrate django-lfs into the same Django installation. Both projects use South, but unfortunately with the same app names!
That leads to the situation, that not all tables are created, because somehow migrations are ignored. For example, both projects have a "core" app.

mezzanine/core/migrations
0001_initial.py
0002_auto__del_keyword.py
0003_auto__add_sitepermission.py
0004_set_site_permissions.py
0005_auto__chg_field_sitepermission_user__del_unique_sitepermission_user.py

lfs/core/migrations
0001_initial.py

I guess the South migration "loader" gets confused by that.

(virtualenv)vagrant@vagrant-ubuntu-precise-64:/vagrant/src$ python manage.py migrate lfs.core --list

 core
  ( ) 0001_initial
  ( ) 0002_auto__del_keyword
  ( ) 0003_auto__add_sitepermission
  ( ) 0004_set_site_permissions
  ( ) 0005_auto__chg_field_sitepermission_user__del_unique_sitepermission_user

(virtualenv)vagrant@vagrant-ubuntu-precise-64:/vagrant/src$ python manage.py migrate mezzanine.core --list

 core
  ( ) 0001_initial
  ( ) 0002_auto__del_keyword
  ( ) 0003_auto__add_sitepermission
  ( ) 0004_set_site_permissions
  ( ) 0005_auto__chg_field_sitepermission_user__del_unique_sitepermission_user

Even if I try to load the migrations for lfs, the wrong migrations from the directory mezzanine.core.migrations are loaded. Is there any chance to solve that naming conflict?

I'm using South 1.0.1 (tried it with 0.8.4 as well).

Cheers,
Christian

Andrew Godwin

unread,
Nov 4, 2014, 12:59:17 PM11/4/14
to south...@googlegroups.com
Hi Christian,

Django actually refers to apps internally by what's called the "app label", which is the last part of the dotted path. Thus, in your case, both apps have an app label of "core" and sadly cannot be in INSTALLED_APPS at the same time.

South is usually the first thing to expose this as you run it early on and it relies on the app labels for distinction, but you'd also have this problem with fixture loading down the line and other parts of Django that use app labels (e.g. content types)

I'm afraid there's no solution apart from renaming one of the apps involved away from "core", or moving up to Django 1.7 where (I believe) you can explicitly set the app label in INSTALLED_APPS by using AppConfig classes rather than dotted paths.

Andrew

--
You received this message because you are subscribed to the Google Groups "South Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to south-users...@googlegroups.com.
To post to this group, send email to south...@googlegroups.com.
Visit this group at http://groups.google.com/group/south-users.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages