{{{
Traceback (most recent call last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Users/szilveszter/Prezi/repo/website-
connected/virtualenv/lib/python2.7/site-
packages/django/core/management/__init__.py", line 385, in
execute_from_command_line
utility.execute()
File "/Users/szilveszter/Prezi/repo/website-
connected/virtualenv/lib/python2.7/site-
packages/django/core/management/__init__.py", line 377, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/szilveszter/Prezi/repo/website-
connected/virtualenv/lib/python2.7/site-
packages/django/core/management/commands/test.py", line 50, in
run_from_argv
super(Command, self).run_from_argv(argv)
File "/Users/szilveszter/Prezi/repo/website-
connected/virtualenv/lib/python2.7/site-
packages/django/core/management/base.py", line 288, in run_from_argv
self.execute(*args, **options.__dict__)
File "/Users/szilveszter/Prezi/repo/website-
connected/virtualenv/lib/python2.7/site-
packages/django/core/management/commands/test.py", line 71, in execute
super(Command, self).execute(*args, **options)
File "/Users/szilveszter/Prezi/repo/website-
connected/virtualenv/lib/python2.7/site-
packages/django/core/management/base.py", line 338, in execute
output = self.handle(*args, **options)
File "/Users/szilveszter/Prezi/repo/website-
connected/virtualenv/lib/python2.7/site-
packages/django/core/management/commands/test.py", line 88, in handle
failures = test_runner.run_tests(test_labels)
File "/Users/szilveszter/Prezi/repo/website-
connected/virtualenv/lib/python2.7/site-packages/django/test/runner.py",
line 147, in run_tests
old_config = self.setup_databases()
File "/Users/szilveszter/Prezi/repo/website-
connected/virtualenv/lib/python2.7/site-packages/django/test/runner.py",
line 109, in setup_databases
return setup_databases(self.verbosity, self.interactive, **kwargs)
File "/Users/szilveszter/Prezi/repo/website-
connected/virtualenv/lib/python2.7/site-packages/django/test/runner.py",
line 299, in setup_databases
serialize=connection.settings_dict.get("TEST_SERIALIZE", True),
File "/Users/szilveszter/Prezi/repo/website-
connected/virtualenv/lib/python2.7/site-
packages/django/db/backends/creation.py", line 374, in create_test_db
test_flush=True,
File "/Users/szilveszter/Prezi/repo/website-
connected/virtualenv/lib/python2.7/site-
packages/django/core/management/__init__.py", line 115, in call_command
return klass.execute(*args, **defaults)
File "/Users/szilveszter/Prezi/repo/website-
connected/virtualenv/lib/python2.7/site-
packages/django/core/management/base.py", line 338, in execute
output = self.handle(*args, **options)
File "/Users/szilveszter/Prezi/repo/website-
connected/virtualenv/lib/python2.7/site-
packages/django/core/management/commands/migrate.py", line 160, in handle
executor.migrate(targets, plan, fake=options.get("fake", False))
File "/Users/szilveszter/Prezi/repo/website-
connected/virtualenv/lib/python2.7/site-
packages/django/db/migrations/executor.py", line 63, in migrate
self.apply_migration(migration, fake=fake)
File "/Users/szilveszter/Prezi/repo/website-
connected/virtualenv/lib/python2.7/site-
packages/django/db/migrations/executor.py", line 91, in apply_migration
if self.detect_soft_applied(migration):
File "/Users/szilveszter/Prezi/repo/website-
connected/virtualenv/lib/python2.7/site-
packages/django/db/migrations/executor.py", line 135, in
detect_soft_applied
apps = project_state.render()
File "/Users/szilveszter/Prezi/repo/website-
connected/virtualenv/lib/python2.7/site-
packages/django/db/migrations/state.py", line 57, in render
self.apps = Apps([AppConfigStub(label) for label in
sorted(self.real_apps + list(app_labels))])
File "/Users/szilveszter/Prezi/repo/website-
connected/virtualenv/lib/python2.7/site-packages/django/apps/registry.py",
line 56, in __init__
self.populate(installed_apps)
File "/Users/szilveszter/Prezi/repo/website-
connected/virtualenv/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: auth
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23483>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* owner: nobody => szilveszter
* needs_better_patch: => 0
* status: new => assigned
* needs_tests: => 0
* needs_docs: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/23483#comment:1>
Comment (by szilveszter):
I'm preparing a pull request with a regression test. Stay tuned.
--
Ticket URL: <https://code.djangoproject.com/ticket/23483#comment:2>
Comment (by szilveszter):
GitHub branch: https://github.com/szilveszter/django/tree/ticket_23483
Pull request: https://github.com/django/django/pull/3215
--
Ticket URL: <https://code.djangoproject.com/ticket/23483#comment:3>
* status: assigned => closed
* resolution: => invalid
Comment:
App labels are required to be unique, per the documentation:
https://docs.djangoproject.com/en/1.7/ref/applications/#django.apps.AppConfig.label
Mostly, I'm quite surprised that this wasn't already a problem for you
under 1.7b4.
You should be able to use a custom `AppConfig` with a `label` attribute to
define an alternative app label for your own `auth` app, as documented in
the above link.
--
Ticket URL: <https://code.djangoproject.com/ticket/23483#comment:4>
* status: closed => new
* resolution: invalid =>
Comment:
Can you please take a look at my pull request, and check out the
regression test yourself? If you remove the line I have added, you'll see
the exception, and it shouldn't happen. The app names and labels are both
unique in the `AppConfig`, but the migration framework uses its own
`AppConfigStub`s that generate this issue.
--
Ticket URL: <https://code.djangoproject.com/ticket/23483#comment:5>
Comment (by carljm):
I apologize, you're right. It wasn't clear to me from the ticket
description that you did have unique app labels on your apps, and I should
have looked at the PR more closely.
On further inspection, I really wonder if, in addition to your fix,
`AppConfigStub` ought to pass `None` rather than `label` as the first
(`app_name`) argument to `AppConfig.__init__`. Passing the label as the
name is clearly wrong -- label and name are two different things. The only
place `AppConfig.name` is used is in auto-generating a label if needed
(which won't be needed after your fix), and in `import_models()` method,
which `AppConfigStub` overrides anyway. Having a `name` of `None` seems
better than having an incorrect name, in that it would fail fast rather
than be wrong in case something in future tries to use
`AppConfigStub.name`.
Checking now to see if that change has negative effects.
--
Ticket URL: <https://code.djangoproject.com/ticket/23483#comment:6>
Comment (by szilveszter):
Sorry, I should have included more information about the `AppConfig`s.
Please let me know if you want me to make the change you suggested, and
I'll update the pull request.
--
Ticket URL: <https://code.djangoproject.com/ticket/23483#comment:7>
* stage: Unreviewed => Ready for checkin
Comment:
The app-registry checks for duplicate names, so setting app name to `None`
is not an option without additional changes. I will merge your fix as-is,
as it's sufficient to fix this bug, and open another issue to track the
potential problem with label-vs-name.
Thanks very much for the report and pull request! Sorry again for the
over-hasty ticket closing.
--
Ticket URL: <https://code.djangoproject.com/ticket/23483#comment:8>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"5e32605ce9baebf07b741c9235ea6351d565ce10"]:
{{{
#!CommitTicketReference repository=""
revision="5e32605ce9baebf07b741c9235ea6351d565ce10"
Fixed #23483 -- Prevented ImproperlyConfigured with dotted app names
Made sure the app labels stay unique for the AppConfigStubs, so
migrations wouldn't fail if two dotted app names has the same last part
(e.g. django.contrib.auth and vendor.auth)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23483#comment:9>
Comment (by szilveszter):
Thanks for the super fast turnaround! Do you think this could get into the
1.7.x branch as well? I think it qualifies as a bug fix for a major new
feature in the series.
--
Ticket URL: <https://code.djangoproject.com/ticket/23483#comment:10>
Comment (by carljm):
Yes, I agree; I am planning to backport it. Just making notes on the other
issue first before I forget.
--
Ticket URL: <https://code.djangoproject.com/ticket/23483#comment:11>
Comment (by Carl Meyer <carl@…>):
In [changeset:"ac1adfbe4a822a3347401f574e64f83e36128cec"]:
{{{
#!CommitTicketReference repository=""
revision="ac1adfbe4a822a3347401f574e64f83e36128cec"
[1.7.x] Fixed #23483 -- Prevented ImproperlyConfigured with dotted app
names
Made sure the app labels stay unique for the AppConfigStubs, so
migrations wouldn't fail if two dotted app names has the same last part
(e.g. django.contrib.auth and vendor.auth)
Backport of 5e32605ce9 from master.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23483#comment:12>
Comment (by Tim Graham <timograham@…>):
In [changeset:"08042f1a73ce6b0feca7a80fc6afc121928b8702"]:
{{{
#!CommitTicketReference repository=""
revision="08042f1a73ce6b0feca7a80fc6afc121928b8702"
Added 1.7.1 release notes for refs #23483.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23483#comment:13>
Comment (by Tim Graham <timograham@…>):
In [changeset:"4b8798cfb9465af1b65ec3cba7ee10b8f969a363"]:
{{{
#!CommitTicketReference repository=""
revision="4b8798cfb9465af1b65ec3cba7ee10b8f969a363"
[1.7.x] Added 1.7.1 release notes for refs #23483.
Backport of 08042f1a73 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23483#comment:14>