django-admin-tools does not see some apps in dashboard

668 Views Asked by At

On devserver all works fine, but in production there are not some apps in admin dashboard.

settings.py

INSTALLED_APPS = (
    'admin_tools',
    'admin_tools.theming',
    'admin_tools.menu',
    'admin_tools.dashboard',

    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.admin',

    'sorl.thumbnail',
    'file_resubmit',
    'django_pencil',

    'blog',
    'core',
    'gallery',
    'nav',
    'options',
    'pages',
    'themes',

    'django_cleanup',
)

Here is code of CustomIndexDashboard.

class CustomIndexDashboard(Dashboard):
    """
    Custom index dashboard for coffee.
    """
    def init_with_context(self, context):
        site_name = get_admin_site_name(context)
        # append a link list module for "quick links"
        self.children.append(modules.LinkList(
            _('Quick links'),
            layout='inline',
            draggable=False,
            deletable=False,
            collapsible=False,
            children=[
                [_('Return to site'), '/'],
                [_('Change password'),
                 reverse('%s:password_change' % site_name)],
                [_('Log out'), reverse('%s:logout' % site_name)],
            ]
        ))

        self.children.append(
            modules.ModelList(u'Navigation', [
                'nav.*',
            ])
        )
        self.children.append(
            modules.ModelList(u'Content', [
                'pages.*',
                'django_pencil.*',
            ])
        )

        self.children.append(
            modules.ModelList(u'Gallery', [
                'gallery.*',
            ])
        )
        self.children.append(
            modules.ModelList(u'Blog', [
                'blog.*',
            ])
        )

        self.children.append(
            modules.ModelList(u'Options', [
                'options.*',
            ])
        )

In dashboard there are not 'pages' and 'gallery' apps. If I turn off django-admin-tools, then those apps appears.

1

There are 1 best solutions below

0
On

Verify if DashboardPreferences on your production site has old configuration. Create a view just to reset current configuration to make sure Preferences are clean.

def reset_dashboard(request):
    prefs = DashboardPreferences.objects.filter(user=request.user)
    prefs.delete()
    prefs = DashboardPreferences(user=request.user)
    prefs.data = '{}'
    prefs.save()
    return HttpResponseRedirect(reverse('admin:index'))