title: How to view redis json data in my template view python django
body: <p>Question how can I get redis json data to show up in my template? For some reason I can't get it to work. Any help would be greatly appreciated..</p>
  
  <p>Here is what I have so far my json data is getting saved to redis correctly but I still can't figure out how to show it in my template. So for obj.customer_name I want it to come from redis and iterate through the json data for my template.</p>
  
  <h1>views.py</h1>
  
  <pre><code>def home(request):
      """Renders the home page."""
      assert isinstance(request, HttpRequest)
      #obj = Customer.objects.all()
      cust = Customer.objects.all()
      da = serializers.serialize('json', cust, fields=('customer_id', 'customer_name'))
      r_conn = redis.StrictRedis(host='172.16.1.98', port=6379, db=1)
      r_conn.set('dimcert_cust', da)
      cust_cache = r_conn.get('dimcert_cust')
      obj = json.load(cust_cache)
  
  
      return render(
          request,
           'app/index.html',
           {
              'title':'Home Page',
              'year':datetime.now().year,
              'obj': obj,
           }
      )
  </code></pre>
  
  <h1>home.html template</h1>
  
  <pre><code>{% extends "app/layout.html" %}
  
  {% block content %}
  
  &lt;div class="jumbotron"&gt;
      &lt;h1&gt;Customers&lt;/h1&gt;
  &lt;/div&gt;
  
  &lt;div class="row"&gt;
  
  
      &lt;div style="width: 40%; float:left"&gt;
          {% for obj in obj.all %}
            &lt;h3&gt; {{obj.customer_name}} &lt;/h3&gt;
          {% endfor %}
  
      &lt;/div&gt;      
  &lt;/div&gt;
  
  {% endblock %}
  </code></pre>
  
  <h1>Here is my model.py with Customer class</h1>
  
  <pre><code>from django.db import models
  import json
  
  class Customer(models.Model):
    objects = models.Manager()
    customer_id = models.IntegerField()
    customer_name = models.CharField(max_length=255)
    created_at = models.DateField
    updated_at = models.DateField
  </code></pre>