title: Django template filter date not working
body: <p>I'm on django 1.4.  </p>
  
  <p>I pass the <code>MY_VAR</code> variable to the home.html template.<br>
  The code showed is simplified. Here's the <code>urls.py</code></p>
  
  <pre><code>import home
  urlpatterns = patterns('',
      # homepage
      url(r'^/?$', home.Home.as_view(), name='home'),
  )
  </code></pre>
  
  <p>And the view <code>home.py</code></p>
  
  <pre><code>from django.conf import settings     
  
  class Home(TemplateView):
      """ this view serves the home template """
      template_name = 'home.html'
  
      def get_context_data(self, *args, **kwargs):
  
          data = {
              'MY_VAR': setting.MY_VAR # where MY_VAR defined in settings.py is a string '2014-12-31'
          }
  
          retun data
  </code></pre>
  
  <p>I have a template variable that I then embed in js:</p>
  
  <pre><code>&lt;!-- source code of home.html --&gt; 
  &lt;script type="text/javascript" charset="utf-8"&gt;
     var myVar = '{{ MY_VAR }}'
  &lt;/script&gt;
  </code></pre>
  
  <p><code>MY_VAR</code> is in the form <code>'2014-12-31'</code>. 
  If I don't use any filter then things work, meaning that the above piece of code will produce this:</p>
  
  <pre><code>&lt;!-- computed home.html --&gt; 
  &lt;script type="text/javascript" charset="utf-8"&gt;
     var myVar = "2014-12-31";
  &lt;/script&gt;
  </code></pre>
  
  <p>but I would like a different date formatting, so if I use a <code>date</code> filter as this</p>
  
  <pre><code>var myVar = '{{ MY_VAR|date }}'
  // or
  var myVar = "{{ MY_VAR|date:'d-m-Y' }}"
  </code></pre>
  
  <p>I always get an empty string <code>var myVar = ''</code> no matter what I pass to the date filter. Also the default <code>{{ MY_VAR|date }}</code> without any formatting param returns an empty string.</p>