Giter VIP home page Giter VIP logo

Comments (15)

arsenalstriker14 avatar arsenalstriker14 commented on May 13, 2024 16

Django 1.8 >
TEMPLATE_LOADERS setting deprecated.
You have to use the TEMPLATES dictionary.
I think you're going to want something like:

settings.py

TEMPLATES = [
{
    'BACKEND': 'django.template.backends.django.DjangoTemplates',
    'DIRS': [os.path.join(BASE_DIR, "templates")],
    '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':[
            'admin_tools.template_loaders.Loader',
            ('django.template.loaders.cached.Loader', [
            'django.template.loaders.filesystem.Loader',
            'django.template.loaders.app_directories.Loader',
            ]),
        ],
    },
},

]

also note – django 1.8 moved from django.core.context_processors to django.template.context_processors

from django-admin-tools.

izimobil avatar izimobil commented on May 13, 2024 7

But have you correctly configured django-admin-tools ?

Since versions 0.7.x, you must add admin_tools.template_loaders.Loader to your template loaders as stated in the release notes and in the documentation.

from django-admin-tools.

Anton-Shutik avatar Anton-Shutik commented on May 13, 2024

@sztankatt Got exactly the same issue when upgrading Django from 1.8.7 to 1.9.1

from django-admin-tools.

sztankatt avatar sztankatt commented on May 13, 2024

@Anton-Shutik Yeah, although I have Django 1.8.5. Also, to clarify, I am running it on ubuntu 14.04 locally.

from django-admin-tools.

Anton-Shutik avatar Anton-Shutik commented on May 13, 2024

@izimobil
That helped for me!

Thanks!

from django-admin-tools.

 avatar commented on May 13, 2024

I'm having the same problem with Django 1.7 but followed the documentation. Django's also whining about admin_tools.template_loaders.TemplateLoader even after I add it to TEMPLATE_LOADERS:

urls.py

urlpatterns = patterns('',
    url(r'^admin_tools/', include('admin_tools.urls')),
    url(r'^admin/',  include(admin.site.urls)),
    ...
)

settings.py

INSTALLED_APPS = (
    'admin_tools',
    'admin_tools.theming',
    'admin_tools.menu',
    'admin_tools.dashboard',
    'django.contrib.auth',
    'django.contrib.admin',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.contenttypes',
    ...
)

TEMPLATES_LOADERS = (
    "admin_tools.template_loaders.Loader",
)

TEMPLATE_CONTEXT_PROCESSORS = (
    "django.contrib.auth.context_processors.auth",
    "django.core.context_processors.debug",
    "django.core.context_processors.i18n",
    "django.core.context_processors.media",
    "django.core.context_processors.static",
    "django.core.context_processors.request",
)

console

$ python manage.py migrate
...

$ python manage.py runserver
Performing system checks...

System check identified some issues:

WARNINGS:
admin_tools: (admin_tools.W001) You must add "admin_tools.template_loaders.TemplateLoader" in your template loaders variable, see: https://django-admin-tools.readthedocs.org/en/latest/configuration.html

System check identified 1 issue (0 silenced).
March 14, 2016 - 19:56:46
Django version 1.7.9, using settings '<redacted>.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

from django-admin-tools.

izimobil avatar izimobil commented on May 13, 2024

You have a typo in your template loaders variable... s/TEMPLATES_LOADERS/TEMPLATE_LOADERS/ . Also, you should put the default Django loaders in it.

from django-admin-tools.

 avatar commented on May 13, 2024

Solved my problem. Fixed the variable name and included the Django loaders as @izimobil advised. Thanks!

from django-admin-tools.

izimobil avatar izimobil commented on May 13, 2024

This is already documented.

from django-admin-tools.

arsenalstriker14 avatar arsenalstriker14 commented on May 13, 2024

Only saw the call to the deprecated TEMPLATE_LOADERS variable. Pardon me for trying to help.

from django-admin-tools.

izimobil avatar izimobil commented on May 13, 2024

Sorry, I didn't meant to be rude :) thanks for your help, if you want to make a pull request on the documentation, you are welcome.

from django-admin-tools.

arsenalstriker14 avatar arsenalstriker14 commented on May 13, 2024

Perhaps I was a bit touchy. Apologies.

from django-admin-tools.

Chiheb-Nexus avatar Chiheb-Nexus commented on May 13, 2024

Thanks @arsenalstriker14 your config worked within django 2

from django-admin-tools.

Smit-mandavia avatar Smit-mandavia commented on May 13, 2024

Thanks @arsenalstriker14 your config worked within django 3.0
I was stuck actually.

from django-admin-tools.

Aqib8860 avatar Aqib8860 commented on May 13, 2024

Django 1.8 >
TEMPLATE_LOADERS setting deprecated.
You have to use the TEMPLATES dictionary.
I think you're going to want something like:

settings.py

TEMPLATES = [
{
    'BACKEND': 'django.template.backends.django.DjangoTemplates',
    'DIRS': [os.path.join(BASE_DIR, "templates")],
    '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':[
            'admin_tools.template_loaders.Loader',
            ('django.template.loaders.cached.Loader', [
            'django.template.loaders.filesystem.Loader',
            'django.template.loaders.app_directories.Loader',
            ]),
        ],
    },
},

]

also note – django 1.8 moved from django.core.context_processors to django.template.context_processors

Really Helpful..................Thnx Its solve my issues!

from django-admin-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.