title: not getting json data from view to template in django
body: <p>I want to  get json data from views and crate column chart. Below is the code
  views.py</p>
  
  <pre><code>def PFTpercentChange(request):
      conn = psycopg2.connect(dbname="geodjango",host='localhost',user='postgres', password='postgres', port=5433)
      cur=conn.cursor()
      cur.execute("SELECT COUNT(species) FROM pft_potential_pft")
      count_pot=cur.fetchall()
      cur.execute("select  count(*) from pft_existing_data_apft e inner join pft_potential_pft p on e.species= p.species ")
      count_actual=cur.fetchall()
      cur.executemany('UPDATE "PFTpercentchange" SET "PFTs_likely_to_change" = ( %s ) where id=1',count_pot)
      conn.commit()
      cur.executemany('UPDATE "PFTpercentchange" SET "PFTs_unchanged" = ( %s ) where id=1',count_actual)
      conn.commit()
      myData = {}
      myData['PFTs_likely_to_change'] = count_pot
      myData['PFTs_likely_to_remain_unchanged'] = count_actual
      json_string = json.dumps(myData)
  
      return JsonResponse(myData, safe=False)
  </code></pre>
  
  <p>urls.py</p>
  
  <pre><code>url(r'^percent/$', TemplateView.as_view(template_name='PFTpercentchange.html'), name='PFTpercentChange')
  </code></pre>
  
  <p>PFTpercentchange.html</p>
  
  <pre><code>var data=$.getJSON('{% url "PFTpercentchange" %}');
  </code></pre>
  
  <p>Im getting error no reverse match. How to solve this?</p>