Write a django template that extends django_nextjs/document_base.html:
{% extends "django_nextjs/document_base.html" %}
{% block head %}
<!-- ... the content you want to place at the beginning of "head" tag ... -->
{{ block.super }}
<!-- ... the content you want to place at the end of "head" tag ... -->
{% endblock %}
{% block body %}
... the content you want to place at the beginning of "body" tag ...
... e.g. include the navbar template ...
{{ block.super }}
... the content you want to place at the end of "body" tag ...
... e.g. include the footer template ...
{% endblock %}
How to Reproduce
In Nextjs 13+, customize the root layout in
app
directory:Write a django template that extends
django_nextjs/document_base.html
:Pass the template name to
render_nextjs_page
: