# 'messages' is not a registered tag library

**URL:** <https://forum.djangoproject.com/t/messages-is-not-a-registered-tag-library/23980>\
**Category:** Mystery Errors\
**Created:** [September 19, 2023, 12:22pm UTC](https://forum.djangoproject.com/t/messages-is-not-a-registered-tag-library/23980 "2023-09-19T12:22:50Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![GrafilIan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/grafilian/32/16021_2.png) [@GrafilIan](https://forum.djangoproject.com/u/GrafilIan)\
**Post date:** [September 19, 2023, 12:22pm UTC](https://forum.djangoproject.com/t/messages-is-not-a-registered-tag-library/23980/1 "2023-09-19T12:22:50Z")

</div>

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:

```auto
'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

```auto
{% 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:

```auto
{% 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>

```

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [September 19, 2023, 12:26pm UTC](https://forum.djangoproject.com/t/messages-is-not-a-registered-tag-library/23980/2 "2023-09-19T12:26:03Z")

</div>

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.)

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [September 19, 2023, 12:28pm UTC](https://forum.djangoproject.com/t/messages-is-not-a-registered-tag-library/23980/3 "2023-09-19T12:28:45Z")

</div>

Please post your complete `INSTALLED_APPS`, `MIDDLEWARE` and `TEMPLATES` settings.

---

<div class="post-metadata">

**Author:** ![GrafilIan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/grafilian/32/16021_2.png) [@GrafilIan](https://forum.djangoproject.com/u/GrafilIan)\
**Post date:** [September 19, 2023, 12:32pm UTC](https://forum.djangoproject.com/t/messages-is-not-a-registered-tag-library/23980/4 "2023-09-19T12:32:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![GrafilIan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/grafilian/32/16021_2.png) [@GrafilIan](https://forum.djangoproject.com/u/GrafilIan)\
**Post date:** [September 19, 2023, 12:37pm UTC](https://forum.djangoproject.com/t/messages-is-not-a-registered-tag-library/23980/5 "2023-09-19T12:37:28Z")

</div>

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’,  
],  
},  
},  
]  
‘’’

---

<div class="post-metadata">

**Author:** ![GrafilIan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/grafilian/32/16021_2.png) [@GrafilIan](https://forum.djangoproject.com/u/GrafilIan)\
**Post date:** [September 19, 2023, 12:40pm UTC](https://forum.djangoproject.com/t/messages-is-not-a-registered-tag-library/23980/6 "2023-09-19T12:40:21Z")

</div>

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’,  
],  
},  
},  
]’‘’

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [September 19, 2023, 12:53pm UTC](https://forum.djangoproject.com/t/messages-is-not-a-registered-tag-library/23980/7 "2023-09-19T12:53:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![GrafilIan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/grafilian/32/16021_2.png) [@GrafilIan](https://forum.djangoproject.com/u/GrafilIan)\
**Post date:** [September 19, 2023, 12:55pm UTC](https://forum.djangoproject.com/t/messages-is-not-a-registered-tag-library/23980/8 "2023-09-19T12:55:40Z")

</div>

This is my installed apps:

```auto
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

```auto
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:

```auto
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’,
],
},
},
]

```

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [September 19, 2023, 12:55pm UTC](https://forum.djangoproject.com/t/messages-is-not-a-registered-tag-library/23980/9 "2023-09-19T12:55:56Z")

</div>

> [@GrafilIan](#):
>
> {% load messages %}

Why do you think this line is needed?

For displaying messages, see the docs at [The messages framework | Django documentation | Django](https://docs.djangoproject.com/en/4.2/ref/contrib/messages/#displaying-messages)

---

<div class="post-metadata">

**Author:** ![GrafilIan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/grafilian/32/16021_2.png) [@GrafilIan](https://forum.djangoproject.com/u/GrafilIan)\
**Post date:** [September 19, 2023, 1:16pm UTC](https://forum.djangoproject.com/t/messages-is-not-a-registered-tag-library/23980/10 "2023-09-19T13:16:52Z")

</div>

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.
