'messages' is not a registered tag library

Hi everyone, new to Django.
I’m struggling with this error:
‘messages’ is not a registered tag library.Must be one of: admin_list,admin_modify, admin_urls, cache, i18n, l10n, log, static, tz.

This error occurs when I use {% load messages %}. I already checked my settings.py and everything looks fine. The:

'django.contrib.messages',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',

are all placed correctly.

And now, I can’t really fix the problem after troubleshooting it all the possible ways that Internet suggests me to do. I hope someone can help me on this. Thank you so much.

btw. This is my scratch login.html looks like

{% extends "base.html" %}

{% block title %}Log In{% endblock %}

{% block content %}
<h2>Log In</h2>

<form method="post">
  {% csrf_token %}

  <!-- Username Field -->
    <div class="form-group">
      <label for="{{ auth_form.username.id_for_label }}">Username</label>
      {{ auth_form.username }}
    </div>

    <!-- Password Field -->
    <div class="form-group">
      <label for="{{ auth_form.password.id_for_label }}">Password</label>
      {{ auth_form.password }}
    </div>
    {{ auth_form.password.errors }}

   {% if auth_form.password.errors %}
   <div class="alert alert-primary" role="alert">
    A simple primary alert—check it out!
  </div>
  {% endif %}
<br>
  <button type="submit">Log In</button>
</form>
{% endblock %}

And here is my base.html:

{% load static %}

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>{% block title %}Django{% endblock %}</title>
  <link rel="stylesheet" type="text/css" href="{% static 'css/styles.css' %}">
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.min.js"></script>
</head>
<body>
  <main>
    {% block content %}
    {% endblock %}
  </main>
</body>
</html>

First, when posting code, templates, or error messages here, please enclose the text between lines of three backtick - ` characters. This means you’ll have a line of ```, then your code (or template, etc), then another line of ```. This forces the forum software to keep your code properly formatted.

(I’m taking the liberty of editing your original post for this. Please remember to do this in the future.)

Please post your complete INSTALLED_APPS, MIDDLEWARE and TEMPLATES settings.

Thank you sir for guiding me here, I am definitely a newbie here. I’ll gonna provide the settings in a minute.

This is my installed apps:

‘’’
INSTALLED_APPS = [
‘internship’,
‘django.contrib.admin’,
‘django.contrib.auth’,
‘django.contrib.contenttypes’,
‘django.contrib.sessions’,
‘django.contrib.messages’,
‘django.contrib.staticfiles’,
]
‘’’

This is my MIDDLEWARE

‘’’
MIDDLEWARE = [
‘django.middleware.security.SecurityMiddleware’,
‘django.contrib.sessions.middleware.SessionMiddleware’,
‘django.contrib.messages.middleware.MessageMiddleware’,
‘django.middleware.common.CommonMiddleware’,
‘django.middleware.csrf.CsrfViewMiddleware’,
‘django.contrib.auth.middleware.AuthenticationMiddleware’,
‘django.middleware.clickjacking.XFrameOptionsMiddleware’,
]
‘’’

And my TEMPALTES:

‘’’
TEMPLATES = [
{
‘BACKEND’: ‘django.template.backends.django.DjangoTemplates’,
‘DIRS’: [os.path.join(BASE_DIR, “templates”)],
‘APP_DIRS’: True,
‘OPTIONS’: {
‘context_processors’: [
‘django.template.context_processors.debug’,
‘django.template.context_processors.request’,
‘django.contrib.auth.context_processors.auth’,
‘django.contrib.messages.context_processors.messages’,
‘django.template.context_processors.static’,
],
},
},
]
‘’’

This is my installed apps:

‘’‘INSTALLED_APPS = [
‘internship’,
‘django.contrib.admin’,
‘django.contrib.auth’,
‘django.contrib.contenttypes’,
‘django.contrib.sessions’,
‘django.contrib.messages’,
‘django.contrib.staticfiles’,
]’‘’

This is my MIDDLEWARE

‘’‘MIDDLEWARE = [
‘django.middleware.security.SecurityMiddleware’,
‘django.contrib.sessions.middleware.SessionMiddleware’,
‘django.contrib.messages.middleware.MessageMiddleware’,
‘django.middleware.common.CommonMiddleware’,
‘django.middleware.csrf.CsrfViewMiddleware’,
‘django.contrib.auth.middleware.AuthenticationMiddleware’,
‘django.middleware.clickjacking.XFrameOptionsMiddleware’,
]’‘’

And my TEMPALTES:

‘’‘TEMPLATES = [
{
‘BACKEND’: ‘django.template.backends.django.DjangoTemplates’,
‘DIRS’: [os.path.join(BASE_DIR, “templates”)],
‘APP_DIRS’: True,
‘OPTIONS’: {
‘context_processors’: [
‘django.template.context_processors.debug’,
‘django.template.context_processors.request’,
‘django.contrib.auth.context_processors.auth’,
‘django.contrib.messages.context_processors.messages’,
‘django.template.context_processors.static’,
],
},
},
]’‘’

Close - you need to use the backtick - ` and not the apostrophe - ', or any type of “smart quotes” from a word processor such as Word.
But yes, those lines of ``` must be lines by themselves and not part of any other line.

This is my installed apps:

INSTALLED_APPS = [
‘internship’,
‘django.contrib.admin’,
‘django.contrib.auth’,
‘django.contrib.contenttypes’,
‘django.contrib.sessions’,
‘django.contrib.messages’,
‘django.contrib.staticfiles’,
]

This is my MIDDLEWARE

MIDDLEWARE = [
‘django.middleware.security.SecurityMiddleware’,
‘django.contrib.sessions.middleware.SessionMiddleware’,
‘django.contrib.messages.middleware.MessageMiddleware’,
‘django.middleware.common.CommonMiddleware’,
‘django.middleware.csrf.CsrfViewMiddleware’,
‘django.contrib.auth.middleware.AuthenticationMiddleware’,
‘django.middleware.clickjacking.XFrameOptionsMiddleware’,
]

And my TEMPALTES:

TEMPLATES = [
{
‘BACKEND’: ‘django.template.backends.django.DjangoTemplates’,
‘DIRS’: [os.path.join(BASE_DIR, “templates”)],
‘APP_DIRS’: True,
‘OPTIONS’: {
‘context_processors’: [
‘django.template.context_processors.debug’,
‘django.template.context_processors.request’,
‘django.contrib.auth.context_processors.auth’,
‘django.contrib.messages.context_processors.messages’,
‘django.template.context_processors.static’,
],
},
},
]

Why do you think this line is needed?

For displaying messages, see the docs at The messages framework | Django documentation | Django

Oh I understand it now. There is no need for me to use the {% load messages %}. I tried to follow the documentation and somehow I see some displays. Now, I just need to figure out how to set it up in my program. Thank you so much Sir.