Show Success or Failure message in Python Django

# Save Flash Message Data
messages.success(request, 'Settings Updated successfully.')
# Show Message in Html from Message variable
{% if messages %}

    {% for message in messages %}

        <div class="alert alert-success">

             <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>

             <strong>Success!</strong> {{message}}

        </div>

    {% endfor %}

{% endif %}
Or Like this,
<div class="col-sm-6">

    {% if messages %}

        <ul class="messages">

            {% for message in messages %}

                <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>

            {% endfor %}

        </ul>

    {% endif %}

</div>

Flash message in php

## include this in every page.. if(isset($_SESSION[“errormsg”])) { $error = $_SESSION[“errormsg”]; session_unset($_SESSION[“errormsg”]); } else { $error = “”; } ## For showing the message just echo $error; ## Set session with with message,when want to show message $_SESSION[“errormsg”] = “This message will be shown there”;