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:- Element-based styling - Override layout and element templates for quick visual changes
- 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 yourTEMPLATES setting is configured correctly:
Template Extension
Setting:ACCOUNT_TEMPLATE_EXTENSIONDefault:
"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 fromallauth/templates/allauth/elements/:
| Template | Description |
|---|---|
alert.html | Display alert messages |
badge.html | Badges for labeling |
button.html | Button element |
button_group.html | Group of related buttons |
details.html | Disclosure widget (<details>) |
field.html | Single form field |
fields.html | All form fields |
form.html | Form container |
h1.html, h2.html | Headings |
hr.html | Horizontal rule |
img.html | Image tag |
panel.html | Card/panel with title, body, actions |
p.html | Paragraph |
provider.html | Social provider link |
provider_list.html | Container for provider list |
table.html, tbody.html, td.html, th.html, thead.html, tr.html | Table 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 templatesallauth/templates/socialaccount/- Social account templatesallauth/templates/mfa/- MFA templates
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: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
- Start with layouts - Override layout templates first for quick wins
- Use element templates - Modify element templates for consistent styling
- Keep structure - Maintain the original template structure and blocks
- Test responsive design - Ensure templates work on all device sizes
- Internationalization - Use
{% trans %}tags for translatable text - Accessibility - Include proper labels, ARIA attributes, and semantic HTML
- Version control - Track which templates you’ve overridden
