title: How can I get the MEDIA_URL from within a Django template?
body: <p>I'm somewhat confused as to how Django operates with static content. Essentially, in the <code>settings.py</code> file, we define <code>MEDIA_URL</code> which points to the URL to use when resolving static media such as scripts and styles, as well as <code>MEDIA_ROOT</code>, a reference to where things live on the filesystem. </p>
  
  <p>However, it doesn't seem clear how I can get access to <code>MEDIA_URL</code> from a template, and it's <em>kind-of-important</em> if I want to use Django's mechanism for loading static content at all. Essentially, I have my base template looking somewhat like this:</p>
  
  <pre><code>&lt;html&gt;
     &lt;head&gt;
         {% block styles %}
         &lt;link rel="stylesheet" href="{{ MEDIA_URL }}styles/master.css"/&gt;
         {% endblock %}
         &lt;title&gt;{% block title %}Page Title{% endblock %}&lt;/title&gt;
     &lt;/head&gt;
     &lt;body&gt;
        {% block scripts %}
        &lt;script type="text/javascript" src="{{ MEDIA_URL }}scripts/jquery.js"&gt;&lt;/script&gt;
        {% endblock %}
     &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Will the above code actually work? I've heard that you have to use other plugins to get something like this up and running, which seems kind of strange, as presumably the whole point behind defining <code>MEDIA_URL</code> is to use it in templates.</p>