I am developing an application (simple online store) with Python Django I have created a base.html file in templates and then all other html files extends from this file but the issue is this, I need the base.html file to have access to Database, so that I can show all names of the categories of products in the header of the file
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="style.css" />
<title>{% block title %}My amazing site{% endblock %}</title>
{% load staticfiles %}
<link rel="stylesheet" type="text/css" media="screen" href="{% static "css/main.css" %}"/>
<link rel="stylesheet" type="text/css" media="screen" href="{% static "bootstrap/css/bootstrap.min-rtl.css" %}" >
<link rel="stylesheet" type="text/css" media="screen" href="{% static "bootstrap/css/bootstrap-responsive.min-rtl.css" %}" >
</head>
<body class="container-fluid" >
<div class="row-fluid" >
<div id="sidebar" class="span12">
{% block sidebar %}
{% endblock %}
</div>
</div>
<div class="row-fluid">
<div class="span8 offset2">
{% block slider %}
{% endblock %}
</div>
</div>
</body>
</html>
how should I create some variables that can be accessible through whole application and I don't have to fetch them from db for every single pages separately ?
thanks in advance for any help