Fix bug in TemplateContextMIddleware

AttributeError: 'TemplateResponse' object has no attribute 'context_data'