django redirect to parent of iframe from view

I am having a web page rendered via iframe. On successfully submitting the form in iframe, i gave,

 return HttpResponseRedirect("www.google.com")

But the target page is also getting loaded within iframe. How to specify the parent to reload from django view?

Answers


Just return some html:

redirect_template.html:

<html>
    <head>
        <script>
            window.top.location.href = '{{ redirect_url }}';
        </script>
    </head>
    <body></body>
</html>

Instead of:

return HttpResponseRedirect("www.google.com")

Use:

return TemplateResponse(request, 'redirect_template.html', {'redirect_url':'www.google.com'}

Need Your Help

Div Taking Screen Width & Height

html css

I've been breaking my head the past two days figuring this out. Basically, i am creating a one page layout, where the first block takes the width and height of the screen and the second block needs...

Make text bold and italic

android xml text bold italics

Is there anyway to make Android text in the xml file both bold and italics?