Get 2024 Templates Mega Bundle!19 Bootstrap HTML, Vue & React Templates + 3 Vector Sets
Get for 99$

How to customize the templates and create custom views


Hi i have a problem, i need to customize a view by passing something specific on the context, but the problem that i have is that if i recall my custom templates inside the default _templates/pages folder they are not recognized as templates (?)
but if i copy the template inside a local "templates" folder inside my app, it say: 'TemplateSyntaxError at /school
Invalid template name in 'extends' tag: ''. Got this from the 'layout' variable. '
How can i resolve this issue? I also tryed copying all the content of _templates folder inside my "templates" folder but it gives the same error.


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (2)


Introducing the eagerly awaited https://www.examcollection.us/JSA-41-01-vce.html Certification Exam [2023] - your gateway to unparalleled expertise and recognition in the field! Crafted with precision and innovation, this exam sets the industry standard for excellence in 2023. Immerse yourself in cutting-edge content designed to challenge, inspire, and validate your skills. Elevate your career prospects and stand out among your peers as a certified JSA-41-01 expert. Join the elite ranks of professionals who have embraced the future with this prestigious certification. Don't miss your chance to be part of the 2023 revolution – seize it now! Embrace the future with JSA-41-01 Certification Exam [2023].



if you want to customize the layout in your views.py file using the KTTheme class, you can add the following code:

def your_view(request):
# Your view logic here

# Update the context to set the custom layout
context.update({
"layout": KTTheme.setLayout("default.html", context),
})

# Return the rendered template with the updated context
return render(request, "your_template.html", context)

Here's what this code does:

Import the KTTheme class from your themes module. Replace 'your_app_name' with the actual name of your app.

In your view function (your_view in this example), add the logic for your view.

Update the context dictionary with the layout using KTTheme.setLayout('default.html', context). This sets the layout for your template to 'default.html'. You can replace 'default.html' with the name of the layout you want to use.

Finally, render your template ('your_template.html' in this example) with the updated context.


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(