render() shortcut displays templates with the request context . The template context processors take the request object and return the dictionary that is added to the context.
A generic context context handler is an ach context handler that accepts a request object and adds a registered user to the context.
If you do not need to render template with a request context, you can use request=None .
def my_view(request): return render(None, "my_template.html", {'foo': 'bar'})
source share