title: Defining "global variable" in Django templates
body: <p>I'm doing something like:</p>
  
  <pre><code>{% extends 'base.html' %}
  {% url myapp.views.dashboard object as object_url %}
  {% block sidebar %}
  ... {{ object_url }} ...
  {% endblock %}
  {% block content %}
  ... {{ object_url }} ...
  {% endblock %}
  </code></pre>
  
  <p>Django documentation says url templatetag can define a variable in context, but I don't get any value for <code>object_url</code> in the following blocks.</p>
  
  <p>If I put the url templatetag at the beginning of each block, it works, but I don't want to "repeat myself".</p>
  
  <p>Anyone knows a better solution?</p>