0
I want to show the results of the variable "date in an iframe called "final.html". when I execute the code in iframe enters an error loop. there’s the code I developed
py views.
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
What is the number of Notifications in {% for n in Notifications %}?
– Rui Lima
I’ve already solved the problem by creating a method that calls iframe and iframe calls the notifition_html method.
– Pnelson
Pnelson, if you have solved the problem, please put the solution as an answer so that other users find it if they come to this question.
– Molx