Skip to main content
django-allauth provides a flexible template system that allows you to customize the look and feel of all authentication pages. You can either completely override templates or use the element-based styling system for quick customization.

Overview

The built-in templates are intentionally plain and unstyled. django-allauth doesn’t make assumptions about your frontend framework, allowing you to use Bootstrap, Tailwind, Material UI, or any other styling approach. There are two main approaches to customizing templates:
  1. Element-based styling - Override layout and element templates for quick visual changes
  2. Full template override - Copy and customize individual templates for complete control

Template Configuration

Django Template Settings

django-allauth templates are discovered via Django’s template loader. Ensure your TEMPLATES setting is configured correctly:

Template Extension

Setting: ACCOUNT_TEMPLATE_EXTENSION
Default: "html"
Source: allauth/account/app_settings.py:457
Change the template file extension:

Element-Based Styling

The fastest way to customize appearance is by overriding layout and element templates. This approach lets you style all pages by modifying just a few files.

Template Structure

Layout Templates

allauth/layouts/base.html

The overall base template for all allauth pages.

allauth/layouts/entrance.html

Layout for authentication pages (login, signup, password reset).

allauth/layouts/manage.html

Layout for account management pages (change password, manage emails).

Element Templates

Elements are reusable components used across templates. Override them to apply consistent styling.

allauth/elements/button.html

allauth/elements/form.html

allauth/elements/field.html

allauth/elements/h1.html

allauth/elements/provider.html

Available Elements

All available element templates from allauth/templates/allauth/elements/:

Full Template Override

For complete control, copy templates from allauth to your project and customize them.

Template Locations

All allauth templates are in:
  • allauth/templates/account/ - Account-related templates
  • allauth/templates/socialaccount/ - Social account templates
  • allauth/templates/mfa/ - MFA templates
Source: allauth/templates on Codeberg

Common Templates

account/login.html

Login page template.

account/signup.html

Signup page template.

account/email.html

Email management page.

Email Templates

Customize email templates sent by allauth:

Email Structure

Each email has three templates:
  • *_subject.txt - Email subject line
  • *_message.txt - Plain text body
  • *_message.html - HTML body (optional)

Common Email Templates

Example: Email Confirmation

Template Tags

django-allauth provides custom template tags.

user_display

Display a user without making assumptions about representation:
Configure display format with ACCOUNT_USER_DISPLAY setting.

provider_login_url

Generate social provider login URLs:

Real-World Examples

Bootstrap 5 Styling

For a complete Bootstrap 5 example, see the example project templates.

Tailwind CSS Example

Best Practices

  1. Start with layouts - Override layout templates first for quick wins
  2. Use element templates - Modify element templates for consistent styling
  3. Keep structure - Maintain the original template structure and blocks
  4. Test responsive design - Ensure templates work on all device sizes
  5. Internationalization - Use {% trans %} tags for translatable text
  6. Accessibility - Include proper labels, ARIA attributes, and semantic HTML
  7. Version control - Track which templates you’ve overridden
  • Forms - Customize form fields and validation
  • Adapters - Customize behavior
  • Settings - Configure template extension