Originally discussed in this 2006 thread, which is no longer open for
replies:
http://groups.google.com/group/django-developers/browse_thread/thread/7197d27127494ee2
I noticed this thread after following the link from the ticket
(#3591), and I'm a little concerned about the direction the ticket has
taken, as it seems to be over-engineering the solution somewhat. I
think a far better solution is to, wherever possible, keep the
application name as the Python package name used in INSTALLED_APPS
instead of trimming it. They're already fully qualified, and if two
Python package names clash they aren't going to work together
regardless of what Django does.
Joseph Kocherhans wrote:
> Admin urls are now like /admin/mypackage/myapp/mymodel
> rather than just /admin/myapp/mymodel.
and:
> Breadcrumbs and admin urls were a lot less complicated before the change.
This particular problem can easily be solved by using a URL like /
admin/mypackage.myapp/mymodel. There isn't any need to split the
application's Python package name up and convert dots to slashes.
> If I run:
> ./manage sql auth (or any other command that takes app_label as the first arg)
> I get the sql for the first auth app that appears in INSTALLED_APPS.
> AFAICT it's impossible to install the second app without switching
> their order in settings.py. That's simply not acceptable.
Solution: have manage take fully-qualified package names as the
application argument.
./manage sql django.contrib.auth
> I imagine there's a similar problem with the filesystem template loader.
Similarly, templates can be in directories like templates/
mypackage.myapp/...
> Table names are still just appname_modelname. Of course you can use
> 'db_table' to fix the issue, but it seems like something that should
> "just work (tm)" I don't really like the idea of prefixing the package
> name, but I don't see any other obvious options. Ideas?
I agree that this is more difficult problem, but a different problem
in that in many cases the database table name prefixes don't need to
be exposed to the user. One thing is certain, table names with dots in
won't work. Table names like django_contrib_auth_user are a little bit
unwieldy, but are valid, fully qualified (so no clashes) and clearly
identify which tables are django's own. (Of course, that's just the
default; there's still db_name for those who need it.)
> Any ideas that don't involve 50+ character table names and 10 level
> deep template directories? ;-)
Well, my idea certainly means that template directory hierarchies are
no deeper than with simple app names, and it means no manual 'tagging'
of app names in INSTALLED_APPS.