Admin Site: TemplateDoesNotExist at /admin/

I ran into the same problem, and I had to force pip to re-download django.

pip install -r requirements.txt --ignore-installed --force-reinstall --upgrade --no-cache-dir

Note: I know that the --no-cache-dir option is necessary, I'm not certain that the other options are all required.


I am using Django Version 1.9.7 and when trying to add the admin_tools (menu and dashboard) to my application I had a similar issue. I found I had to do three things:

  1. Edit the INSTALLED_APPS option in settings.py as follows (note that the admin_tools come before django contrib, 'mines' is the name of my application):

    INSTALLED_APPS = [
        'admin_tools',
        'admin_tools.theming',
        'admin_tools.menu',
        'admin_tools.dashboard',
        'django.contrib.admin',
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'django.contrib.sessions',
        'django.contrib.messages',
        'django.contrib.staticfiles',
        'mines'
    ]
    
  2. Edit the TEMPLATE setting in the settings.py file as follows (note the 'loaders' option that got added, and that APP_DIRS are now set to false):

    TEMPLATES = [{
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': False,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
            'loaders': [
                'django.template.loaders.filesystem.Loader',
                'django.template.loaders.app_directories.Loader',
                'admin_tools.template_loaders.Loader',
            ],
        },
    }]
    
  3. And then finally I updated my urls.py file as follows (note the include for the admin_tools urls):

    from django.conf.urls import include,url
    from django.contrib import admin
    from mines.views import SummaryByMapIcon
    
    urlpatterns = [
        url(r'^admin_tools/', include('admin_tools.urls')),
        url(r'^admin/', admin.site.urls),
        url(r'^summarybymapicon$', SummaryByMapIcon, name='summarybymapicon'),
    ]