title: jQuery ui autocomplete with Django return 404
body: <p>I'm implementing an autocomplete search using jQuery UI and Django models.</p>
  
  <p>Here is my <code>view</code>:</p>
  
  <pre><code>def get_ticker(request):
      if request.is_ajax():
          q = request.GET.get('term', '')
          symbols = Symbol.objects.filter(name__istartswith=q)
          results = []
          for symbol in symbols:
              symbol_json = {'name': symbol.name, 'symbol': symbol.symbol}
              results.append(symbol_json)
          data = json.dumps(results)
      else:
          data = 'Can\'t get data...'
      mimetype = 'application/json'
  return HttpResponse(data, mimetype)
  </code></pre>
  
  <p><code>url</code>:</p>
  
  <pre><code>url(r'^api/get_ticker/$', views.get_ticker, name='get_ticker'),
  </code></pre>
  
  <p><code>js</code>:</p>
  
  <pre><code>$(function() {
     $("#ticker").autocomplete({
        source: "{% url get_ticker %}",
        minLength: 2,
     });
  });
  </code></pre>
  
  <p><code>html</code>:</p>
  
  <pre><code> &lt;div class="ui-widget"&gt;
        &lt;input type="text" id="ticker"&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>When I type in search box, I get error:</p>
  
  <pre><code>GET http://127.0.0.1:8000/finance/%7B%%20url%20get_ticker%20%%7D?term=hello 404 (NOT FOUND)
  </code></pre>