The templates that are offered out of the box are intentionally plain and without any styling. We do not want to pick a side in the multitudes of frontend styling options out there, and the look and feel typically should be adjusted to match the branding of your project. Therefore it is recommended that you copy all templates over to your own project and adjust them as you see fit.

Having said that, over time the years the complexity of authentication grew considerably. For example, with features such as third party account providers and two-factor authentication adjusting the templates involves a lot more than just styling a login.html and a signup.html template. Therefore, a mechanism is included that allows you to adjust the look and feel of all templates by only overriding a few core templates. This approach allows you to achieve visual results fast, but is of course more limited compared to styling all templates yourself.

Overriding the Built-In Templates#

The allauth app includes all templates, and can be found in the allauth/templates directory. When allauth is part of your INSTALLED_APPS, and "APP_DIRS": True is configured, Django will be able to find its templates. As DIRS is searched before APP_DIRS, overriding the templates involves adding an entry to DIRS that points to your a project specific template folder, as follows:

from pathlib import Path

BASE_DIR = Path(__file__).resolve().parent.parent

        "BACKEND": "django.template.backends.django.DjangoTemplates",
        "DIRS": [
            BASE_DIR / "templates"
        "APP_DIRS": True,
        "OPTIONS": {
            "context_processors": [

If you copy over all templates to your BASE_DIR / "templates" it should contain these entries (a.o.):

  • An account folder containing the templates from the allauth.account app.

  • A socialaccount folder containing the templates from the allauth.socialaccount app.

  • A mfa folder containing the templates from the allauth.mfa app.

  • An allauth folder containing the overall styling templates (see the next section).

Styling the Existing Templates#

Instead of copying all templates, a mechanism is included that allows you to adjust the look and feel of all templates by only overriding a few core templates. This approach allows you to achieve visual results fast, but is of course more limited compared to styling all templates yourself.


The existing templates use two base page layouts:

  • The entrance layout: These are all pages where the user is in the process of authenticating, such as the login and signup pages.

  • The account management layout: The pages where an authenticated user can manage the account, such as changing the email address or password.

You can alter these layouts by providing these templates in your own project:

Template file



The overall base template.


The entrance template, extending the base template.


The account management template, extending the base template.


When rendering e.g. a Bootstrap button you would typically use:

<button class="btn btn-primary">Okay</button>

Yet, when a different CSS framework is used other class names apply, and possibly even other markup. Therefore, the built-in templates do not include the above content directly. Instead of referring to tags such <button>, <h1> or <form> directly, the templates render those elements using a special element templatetag:

{% load allauth %}
{% element h1 tags="foo,bar" %}Welcome{% endelement %}

Under the hood, this templatetag renders the allauth/elements/h1.html template, which out of the box contains this:

{% load allauth %}<h1>{% slot default %}{% endslot %}</h1>

If you want to change the styling of all headings across all pages, you can do so by overriding that allauth/elements/h1.html template, as follows:

{% load allauth %}
<div class="myproject-h1 aa-{{ origin|slugify }}"
     style="font-size: {% if "foo" in attrs.tags %}3{% else %}5{% endif %}rem">
    {% slot default %}{% endslot %}

Of course, the above is a bit of a contrived example. In each of the element templates the {{ origin }} context variable is available, which is equal to the base template name where the element is used (e.g. account/login for elements used from within the account/login.html template).

The following elements are available – override them as you see fit for your project:

Template file



Display alert messages.


Badges for labeling purposes.


A button (<button>).


A single form field.


The form fields, uses {{form.as_p}} by default, hence, not rendering the field.html.


The <form> container tag.


Level 1 heading (<h1>).


Level 2 heading (<h2>).


Horizontal rule (<hr>).


An image tag (<img>).


A panel (aka card), consisting of a title, body and actions.


Paragraphs (<p>).


A link to a third-party provider.


The container element for the list of third-party providers.


Table <table> container.


The source repository contains a Bootstrap styled example project, which provides a good example of how all of the above can be put together to provide styling without altering any of the content templates. Please take a look at the templates of the example project. You can see those templates live in the running demo project.