Custom allauth template with Django 1.8

506 views Asked by At

I read many different setup for getting allauth working with django in general, and 1.8 specifically but none is working.

here is my current setup with allauth 0.29:

TEMPLATES = [
    {
        'BACKEND' : 'django.template.backends.django.DjangoTemplates',
        'DIRS': [ os.path.join( BASE_DIR, 'templates' ), os.path.join( BASE_DIR, 'templates', 'allauth' ) ],
        'APP_DIRS': True,
        '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',
            ],
        },
    },
]

With all Allauth accounts templates in

basedir/templates/allauth/accounts

Altough all allauth template pickup the site's base template, any modification to the template in tis directory are royally ignored. if you have this working with django 1.8 please describe your setup.

2

There are 2 answers

0
cdvv7788 On BEST ANSWER

To override templates you must put a folder with the name of the app inside of your templates folder. In your case you want something like:

templates/account
0
Robert Brax On

It turns out that you can only override templates in a django APP template dir. Not the main template dir, even if properly configured. And that app must be loaded before all the allauth app in your settings.py .

That's weird since the allauth templates are supposed to affect site wide authentication process, not just a specific app in a project. I ended up create an app "allauthapp" specifically for overriding templates.