[Answer]-Set custom background image in django

1👍

What you can do is create another sub block in base template and set background for the parent block. Each page will modify contents of sub-block but not the background.

E.g.

incident/base_report.html

...
{% block main-content-parent %}
  {# code to set background image #}

  {% block main-content %}
  {%endblock%}
{%endblock%}

somepage_template.html

{% extends "incident/base_report.html" %}
{%block main-content %}
   {# your content #}
{%endblock%}
👤Rohan

Leave a comment