# Django 5.0.3 problem with bootstrap 5

**URL:** <https://forum.djangoproject.com/t/django-5-0-3-problem-with-bootstrap-5/28772>\
**Category:** Mystery Errors\
**Created:** [March 6, 2024, 2:42pm UTC](https://forum.djangoproject.com/t/django-5-0-3-problem-with-bootstrap-5/28772 "2024-03-06T14:42:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![OJ-TV](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/oj-tv/32/19659_2.png) [@OJ-TV](https://forum.djangoproject.com/u/OJ-TV)\
**Post date:** [March 6, 2024, 2:42pm UTC](https://forum.djangoproject.com/t/django-5-0-3-problem-with-bootstrap-5/28772/1 "2024-03-06T14:42:40Z")

</div>

**Hello, I’ve bootstrap 5 installed :**

(vitual\_env) C:\test1\>pip list  
Package Version

* * *

asgiref 3.7.2  
beautifulsoup4 4.12.3  
Django 5.0.3  
django-bootstrap5 23.4  
mysqlclient 2.2.4  
pillow 10.2.0  
pip 24.0  
soupsieve 2.5  
sqlparse 0.4.4  
tzdata 2024.1

(vitual\_env) C:\test1\>

**When I try to use that, I’ve this error :**

(vitual\_env) C:\test1\>py manage.py runserver  
Watching for file changes with StatReloader  
Exception in thread django-main-thread:  
Traceback (most recent call last):  
File “C:\Users\Johann\AppData\Local\Programs\Python\Python312\Lib\threading.py”, line 1073, in \_bootstrap\_inner  
self.run()  
File “C:\Users\Johann\AppData\Local\Programs\Python\Python312\Lib\threading.py”, line 1010, in run  
self.\_target(\*self._args, \*\*self.kwargs)  
File “C:\Users\Johann\AppData\Local\Programs\Python\Python312\Lib\site-packages\django\utils\autoreload.py”, line 64, in wrapper  
fn(\*args, \*\*kwargs)  
File “C:\Users\Johann\AppData\Local\Programs\Python\Python312\Lib\site-packages\django\core\management\commands\runserver.py”, line 125, in inner\_run  
autoreload.raise\_last\_exception()  
File “C:\Users\Johann\AppData\Local\Programs\Python\Python312\Lib\site-packages\django\utils\autoreload.py”, line 87, in raise\_last\_exception  
raise exception[1]  
File "C:\Users\Johann\AppData\Local\Programs\Python\Python312\Lib\site-packages\django\core\management\_init.py", line 394, in execute  
autoreload.check\_errors(django.setup)()  
File “C:\Users\Johann\AppData\Local\Programs\Python\Python312\Lib\site-packages\django\utils\autoreload.py”, line 64, in wrapper  
fn(\*args, \*\*kwargs)  
File "C:\Users\Johann\AppData\Local\Programs\Python\Python312\Lib\site-packages\django\_init.py", line 24, in setup  
apps.populate(settings.INSTALLED\_APPS)  
File “C:\Users\Johann\AppData\Local\Programs\Python\Python312\Lib\site-packages\django\apps\registry.py”, line 91, in populate  
app\_config = AppConfig.create(entry)  
^^^^^^^^^^^^^^^^^^^^^^^  
File “C:\Users\Johann\AppData\Local\Programs\Python\Python312\Lib\site-packages\django\apps\config.py”, line 193, in create  
import\_module(entry)  
File "C:\Users\Johann\AppData\Local\Programs\Python\Python312\Lib\importlib\_init_.py", line 90, in import\_module  
return \_bootstrap.\_gcd\_import(name[level:], package, level)  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “”, line 1387, in \_gcd\_import  
File “”, line 1360, in \_find\_and\_load  
File “”, line 1324, in \_find\_and\_load\_unlocked  
ModuleNotFoundError: No module named ‘bootstrap5’

**My setting.py was configured :**

INSTALLED\_APPS = [  
‘django.contrib.admin’,  
‘django.contrib.auth’,  
‘django.contrib.contenttypes’,  
‘django.contrib.sessions’,  
‘django.contrib.messages’,  
‘django.contrib.staticfiles’,  
‘clt’,  
‘bootstrap5’,  
]

**and this is my home.html :**

```auto
> {% load bootstrap5 %}
> <!DOCTYPE html>
> <html data-bs-theme="light" lang="en">
> 
> <head>
> <meta charset="utf-8">
> <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
> <title>Django First</title>
> {% bootstrap_css %}
> {% bootstrap_javascript %}
> </head>
> 
> <body>
> <nav class="navbar navbar-expand-md bg-dark py-3" data-bs-theme="dark">
> <div class="container"><a class="navbar-brand d-flex align-items-center" href="#"><span class="bs-icon-sm bs-icon-rounded bs-icon-primary d-flex justify-content-center align-items-center me-2 bs-icon"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 16 16" class="bi bi-bezier">
> <path fill-rule="evenodd" d="M0 10.5A1.5 1.5 0 0 1 1.5 9h1A1.5 1.5 0 0 1 4 10.5v1A1.5 1.5 0 0 1 2.5 13h-1A1.5 1.5 0 0 1 0 11.5v-1zm1.5-.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1zm10.5.5A1.5 1.5 0 0 1 13.5 9h1a1.5 1.5 0 0 1 1.5 1.5v1a1.5 1.5 0 0 1-1.5 1.5h-1a1.5 1.5 0 0 1-1.5-1.5v-1zm1.5-.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1zM6 4.5A1.5 1.5 0 0 1 7.5 3h1A1.5 1.5 0 0 1 10 4.5v1A1.5 1.5 0 0 1 8.5 7h-1A1.5 1.5 0 0 1 6 5.5v-1zM7.5 4a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1z"></path>
> <path d="M6 4.5H1.866a1 1 0 1 0 0 1h2.668A6.517 6.517 0 0 0 1.814 9H2.5c.123 0 .244.015.358.043a5.517 5.517 0 0 1 3.185-3.185A1.503 1.503 0 0 1 6 5.5v-1zm3.957 1.358A1.5 1.5 0 0 0 10 5.5v-1h4.134a1 1 0 1 1 0 1h-2.668a6.517 6.517 0 0 1 2.72 3.5H13.5c-.123 0-.243.015-.358.043a5.517 5.517 0 0 0-3.185-3.185z"></path>
> </svg></span><span>Django First</span></a><button data-bs-toggle="collapse" class="navbar-toggler" data-bs-target="#navcol-5"><span class="visually-hidden">Toggle navigation</span><span class="navbar-toggler-icon"></span></button>
> <div class="collapse navbar-collapse" id="navcol-5">
> <ul class="navbar-nav ms-auto">
> <li class="nav-item"><a class="nav-link active" href="#">Client</a></li>
> <li class="nav-item"><a class="nav-link" href="#">contact</a></li>
> <li class="nav-item"><a class="nav-link" href="#">info</a></li>
> </ul><a class="btn btn-primary ms-md-2" role="button" href="#">MENU</a>
> </div>
> </div>
> </nav>
> </body>
> 
> </html>

```

**I’ve try to unistall and install (pip install django-bootstrap5) but I’ve the same problems, I cant runserver**  
**Thank you for your help**

---

<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:** [March 6, 2024, 2:56pm UTC](https://forum.djangoproject.com/t/django-5-0-3-problem-with-bootstrap-5/28772/2 "2024-03-06T14:56:57Z")

</div>

The package “django-bootstrap5” is _not_ Bootstrap. It’s an interface layer created to make working with bootstrap easier in Django.

See the docs for using it at [django-bootstrap5 · PyPI](https://pypi.org/project/django-bootstrap5/)

---

<div class="post-metadata">

**Author:** ![mohammad-yasin-afjae](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/mohammad-yasin-afjae/32/15086_2.png) [@mohammad-yasin-afjae](https://forum.djangoproject.com/u/mohammad-yasin-afjae)\
**Post date:** [October 1, 2024, 7:49am UTC](https://forum.djangoproject.com/t/django-5-0-3-problem-with-bootstrap-5/28772/3 "2024-10-01T07:49:53Z")

</div>

i have the same problem and i unistall bootstrap ande after that i install that but not work and give eror in my code

---

<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:** [October 1, 2024, 12:22pm UTC](https://forum.djangoproject.com/t/django-5-0-3-problem-with-bootstrap-5/28772/4 "2024-10-01T12:22:36Z")

</div>

If you’re encountering an issue with which you would like assistance, please open up a new topic for that discussion. When you do so, include all the details about the error (complete error message and traceback).

This thread has been marked as solved, and so your post here is unlikely to attract much attention.
