Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django 1.8 Configuration #61

Closed
datamafia opened this issue Aug 1, 2016 · 1 comment
Closed

Django 1.8 Configuration #61

datamafia opened this issue Aug 1, 2016 · 1 comment

Comments

@datamafia
Copy link

Hello.

In upgrading an app that uses admin tools to 1.8 we have a config issue.

The current config:

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [ ... ],
        'APP_DIRS': False,
        'OPTIONS': {
            'context_processors': [ ... ],
            'loaders': [
                 'admin_tools.template_loaders.Loader',
             ],        
        },
    },
]

The APP_DIRS when set to True allows per app template directory discovery. To use the loaders then APP_DIRS must be False.

Is there a compromise? With APP_DIRS set to False all of the templates break in all of the apps.

As of yet I can't get a working prototype to pull the app templates back in (syntax?), only auto-discover works as of now.

I am guessing the use of loaders is an architectural decision. I have begun to trace the code but I would also like to know if I am missing something or another way of finding a solution.

Thanks in advance

@izimobil
Copy link
Member

izimobil commented Aug 2, 2016

Hi,

Just set your loaders like this:

[
    'admin_tools.template_loaders.Loader',
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
]

Having APP_DIRS set to True is basically the same as adding 'django.template.loaders.app_directories.Loader' in your template loaders.

BTW I find this setting variable (APP_DIRS) very confusing, I think the django folks should deprecate it.

@izimobil izimobil closed this as completed Aug 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants