Answer the question
In order to leave comments, you need to log in
How to properly work with templates in Django?
Good day.
I have a template structure like this (Django-Wagtail):base.html
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
...
</head>
<body class="{% block body_class %}{% endblock %}">
<header class="header">
{% block navigation %}
{% include "partials/navigation.html" %}
{% endblock navigation %}
</header>
<main class="main">
{% block content %}{% endblock %}
</main>
{% block footer %}
{% include "partials/footer.html" %}
{% endblock footer %}
{% block extra_js %}{% endblock %}
</body>
</html>
footer.html
:<footer class="footer ">
<div class="container">
{% block contact_us_form %}
{% endblock contact_us_form %}
<div class="footer__request">
</div>
<div class="footer__colophon">
<div></div>
<div> </div>
</div>
</div>
</footer>
home.html
:{% extends "base.html" %}
{% block content %}
Content here
{% endblock content %}
{% block contact_us_form %}
Code for form
{% endblock contact_us_form %}
contact_us_form
on the home page in any way. Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question