Skip to content Skip to sidebar Skip to footer

Django: Internet Explorer Download Page Content Instead Of Rendering It

I am creating a website using Django Web Framework. When I view it with browsers like chrome, safari, firefox, etc it work properly, but if I open the page in Internet Explorer thi

Solution 1:

You are passing invalid arguments to render(). From the docs, it takes the following arguments:

render(request, template_name, context=None, content_type=None, status=None, using=None)

You are passing context to the content_type argument, which somehow doesn't break altogether, but ends up in the response not containing a text/html content type. Hence IE tries to download it.

Remove that last argument:

response = render(request, 'base_home.html', context_list)

Post a Comment for "Django: Internet Explorer Download Page Content Instead Of Rendering It"