The New Way to Build with AI! Introducing ReUI — the developer platform for agentic UI with shadcn/ui
Browse ReUI Pro

django allauth


I try to use django-allauth.
It works but i want to overwrite defaults templates.

So, under _templates. I created account/login.html.

the path is ok for django-allauth but i have this erro :

TemplateSyntaxError at /accounts/login/

Invalid template name in 'extends' tag: ''. Got this from the 'layout' variable.


It don't find : {% extends layout %}

How to solve it please ?

Regards


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (73)

 
Deleted comment
 
Deleted comment
 
Deleted comment
 
Deleted comment
 
Deleted comment
 
Deleted comment
 
Deleted comment
 
Deleted comment
 
Deleted comment

Good day! This post could not be written any better! Reading this post reminds me of my previous room mate! He always kept chatting about this. I will forward this write-up to him. Fairly certain he will have a good read. Thanks for sharing! Sugar Defender


Deleted comment
 
Deleted comment

Hi! This is my first visit to your blog! We are a group of volunteers and starting a new project in a community in the same niche. Your blog provided us beneficial information to work on. You have done a extraordinary job! JavaBurn


 
Deleted comment
 
Deleted comment
Deleted comment

You're welcome! If you have any more questions or need further assistance, please don't hesitate to ask.



I apologise for the delay. To address the issue with the TemplateSyntaxError and the layout variable in django-allauth when trying to override default templates, you can follow these steps:

Check Default Layout Variable:
The error indicates that it's trying to find the layout variable, but it's not provided. By default, the layout variable is set globally in the file /django_demo1/starterkit/_keenthemes/__init__.py like this:

context.update({
"layout": KTTheme.setLayout("default.html", context),
})


Override Layout Variable:
You can override the layout variable value in your views.py file or wherever you are rendering the template. For example, in your view function, you can set the layout variable like this:

from django.shortcuts import render

def my_login_view(request):
# Your view logic here
context = {
# Other context variables
"layout": "your_custom_layout.html", # Set your custom layout here
}
return render(request, "account/login.html", context)

Replace 'your_custom_layout.html' with the path to your custom layout template.

By overriding the layout variable in your views, you can specify the layout you want to use for the account/login.html template and resolve the TemplateSyntaxError.



thank you Faizal


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
buy metronic keenthemes mega bundle

ReUI

Open-source React components, blocks and templates built on shadcn/ui and Tailwind CSS by Keenthemes.