title: Django variable in base.html
body: <p><code>base.html</code> is used as the base template for all other pages. <code>base.html</code> has the navigation bar and in the navigation bar, I want to show the number of messages the user received. Thus, I need to have a variable like <code>{{number_of_messages}}</code> in the <code>base.html</code>.</p>
  
  <p>However, how should I pass this variable to it? Every template extends <code>base.html</code> and is rendered by a function. I don't think returning <code>number_of_messages</code> in all functions is a good way. Is there better way to implement this? How can I pass this variable to all templates?</p>