Results in iframe

0

I want to show the results of the variable "date" in an iframe called "final.html", when I execute the code in the iframe it goes into a loop that results in an error.

views.py

def notification_html(request):
    data = _notification(request, url)
    render(request, 'notification_result.html', {'notifications': data})
    return render(request,'final.html')

notification_result.html

<body>
    {% if notifications %}
        <ul>
           {% for n in notifications %}
                <li style="background-color:{{ n.notification_type.color }}"><b>{{ n.title }}</b> - {{ n.description }} </li>
            {% endfor %}
        </ul>
    {% else %}
        <p>No notifications.</p>
    {% endif %}
    </body>

final.html

<body>
<iframe width="100%" height=auto style="border: none" src="notification_result.html" name="iframe_notification"></iframe>
Hi and welcome this page contains the iframe
</body>

The code works perfectly without the iframe

    
asked by anonymous 09.04.2015 / 12:10

1 answer

1

Resolved: The solution was to create a method that calls the iframe and iframe calls the notification_htmlv2 method.

def notification_html(request):
    url = request.META["QUERY_STRING"]
    return render(request, 'TTS Corporate.html', {"notes": '/notification_htmlv2/?' + url})


def notification_htmlv2(request):
    url = request.META["QUERY_STRING"]
    urls = decode(url)
    data = _notification(request, urls)
    return render(request, 'notification_result.html', {'notifications': data})

final.html

<iframe width="100%" src="{{ notes }}">
<p>Your browser does not support iframes.</p></iframe>
    
09.04.2015 / 17:12