I'm trying to display messages to the user when they login/signup using the alert function of javascript. I'm trying something like this, but it doesn't seem to work.
What is the correct syntax to pass django's variables to the script in a template?
This is what I want but this syntax doesn't work.
{% if messages %}{% for message in messages %}<script>alert({{}});</script>{% endfor %}{% endif %}
However the following is working:
{% if messages %}<ul>{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}</ul>{% endif %}