I understand everything from this code:
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))
Except this line: ‘\n’.join(html)
So \n creates a new line for every table I assume.
But what does join(html) do?
It basically puts a newline between every item in
html.So if
that piece of code will create this string:
http://docs.python.org/library/stdtypes.html#str.join