I need to list all values from request.META in Django using template.

I've done it without template like this
(code from my views.py)

def display_meta(request):
  values = request.META.items()
  values.sort()
  html = []
  for k, v in values: 
      html.append(‘<tr><td>%s</td><td>%s</td></tr>’ % (k, v))
  return HttpResponse(‘<table>%s</table>’ % ‘\n’.join(html))

For example I have template 'values.html', how can I do the same as above 
but using template and not hardcoding html in views.py?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4673f20b-aa76-4012-882b-fa370299ba1a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to