djangodjango-modelsdjango-templatesdjango-admindjango-admin-tools

Change app label of groups in Django 1.5


I have extended the User model, but now the new user model is in an app called "account" which gives all models inside this app the app label "account". The Django model "Groups" still has the app label "Auth", so now models which all has something to do with auth is in separate apps in the admin site. Is it possibly to change the app label for "Groups"?


Solution

  • Try this:

    from django.db.models.loading import get_models
    get_models(django.contrib.auth.models)[1]._meta.app_label = 'group' #or whatever