﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24776	apps.get_app_config() could give better errors on fully-qualified package names	Peter Inglesby	nobody	"Running eg `./manage.py dumpdata django.contrib.auth` fails with `CommandError: Unknown application: django.contrib.auth`.  Instead, you need to call the command with just `auth`.

This is because it calls through to `apps.get_app_config` which does not expect a fully-qualified package name.

There is a similar problem with other management commands that take an app's name.

There are a handful of approaches to fixing this:

1. `apps.get_app_config` should split a package name on dots, throw away all but the last token, and use this for looking up the app.  I've not thought through all the consequences of this -- could an app name legitimately contain dots?
2. As for 1, but only if the package name begins `django.contrib`.
3. When `apps.get_app_config` raises a `LookupError`, it could check to see whether its argument contains dots, and its message could be something like `No installed app with label 'x.y.z'.  Did you mean 'z'?`.
4. Whenever a management command calls `apps.get_app_config`, it could strip off `django.contrib.` if present.

I'm happy to code up a fix if/when the right approach is settle on."	Cleanup/optimization	closed	Core (Other)	dev	Normal	fixed			Accepted	0	0	0	0	0	0
