我有一个通过 iframe 呈现的网页。在 iframe 中成功提交表单后,我给出了,
 return HttpResponseRedirect("www.google.com")
但是目标页面也在 iframe 中加载。如何指定要从 django 视图重新加载的父级?
只需返回一些 html:
redirect_template.html:
<html>
    <head>
        <script>
            window.top.location.href = '{{ redirect_url }}';
        </script>
    </head>
    <body></body>
</html>
代替:
return HttpResponseRedirect("www.google.com")
利用:
return TemplateResponse(request, 'redirect_template.html', {'redirect_url':'www.google.com'}