added request to render response in _generate_response for compatibility with Django 1.5