under django 1.7: ImproperlyConfigured: Application labels aren't unique, duplicates: auth

Bug #1431464 reported by Daniel Manrique
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Capomastro
Fix Released
High
Daniel Manrique

Bug Description

This happened when adding the capomastro.auth application with the changepassword command. The name is the same as django.contrib.auth app because we want them to show in the same manage.py category. However, under Django 1.7, application names (which I understand naively to be the last component of the module's dotted path) have to be unique. Thus, when starting capomastro under Python 1.7, I get:

django.core.exceptions.ImproperlyConfigured: Application labels aren't unique, duplicates: auth

This doesn't happen when running tox for testing, so it was a bit tricky to catch, it only happens when running a management command or the server.

This doesn't impact 1.6 or earlier.

The solution is to relabel the application explicitly:

from django.apps import AppConfig
  default_app_config = 'capomastro.auth.AuthConfig'

class AuthConfig(AppConfig):
      name = "capomastro.auth"
      label = "capomastro auth commands"

A problem, however, is that this is not available in pre-1.7 django, which will make for some fun conditional coding.

Related branches

Daniel Manrique (roadmr)
Changed in capomastro:
importance: Undecided → High
status: New → In Progress
assignee: nobody → Daniel Manrique (roadmr)
Daniel Manrique (roadmr)
Changed in capomastro:
milestone: none → 2015-04
Daniel Manrique (roadmr)
Changed in capomastro:
status: In Progress → Fix Committed
Daniel Manrique (roadmr)
Changed in capomastro:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.