How to activate notification Bootstrap 4?

At bootstrap there is a notification.

How to activate the notification? The documentation only says how to close it.

Scenario: User entered the data, clicked on the button. Data were checked and if they are invalid is called a notification.
April 19th 20 at 12:18
2 answers
April 19th 20 at 12:20
views:

from django.contrib import messages
 if user is not None:
 login(request, user)
 messages.success(request, 'logged in')
else:
 messages.error(request, "Incorrect login")


Templates/AppName/Messages.html:
{% for message in messages %}
 <div class="alert {{ message.tags }} alert-dismissible" role="alert">
 <button type="button" class="close" data-dismiss="alert" aria-label="Close">
 <span aria-hidden="true">&times;</span>
</button>
 {{ message }} {{ user.first_name}} {{ user.last_name}}
</div>
{% endfor %}


Нужный_шаблон.html:
<div class="col-md-4">
 {% include 'AppName/messages.html' %}
 </div>
April 19th 20 at 12:22
The alert initially to register the class d-noneto alert was not displayed, and then when you want to display an alert with this class to remove:
$('#alert').removeClass('d-none');

Find more questions by tags Bootstrap