bcoop713 bcoop713 - 1 year ago 216
Python Question

Django-allauth loads wrong base.html template

I've been trying to get django-allauth working for a couple days now and I finally found out what was going on.

Instead of loading the

template that installs with django-allauth, the app loads the
file that I use for the rest of my website.

How do i tell django-allauth to use the base.html template in the
directory instead of my

Answer Source

Unless called directly, your base.html is an extension of the templates that you define.

For example, if you render a template called Page.html - at the top you will have {% extends "base.html" %}.

When defined as above, base.html is located in the path that you defined in your settings.py under TEMPLATE_DIRS = () - which, from your description, is defined as project/template.

Your best bet is to copy the django-allauth base.html file to the defined TEMPLATE_DIRS location, rename it to allauthbase.html, then extend your templates to include it instead of your default base via {% extends "allauthbase.html" %}.

Alternatively you could add a subfolder to your template location like project/template/allauth, place the allauth base.html there, and then use {% extends "allauth/base.html" %}.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download