You can use the latest version of bootstrap (bootstrap5) in django by install the module in your virtual environment.
There's other ways you can achieve that too -> include CDN, download the required files in include them in your project. But my favorite one is install the module.
Letsgooo.
inside your project active the virtual environment source myEnv/bin/activate
if you're using venv as your virtual environment.
:: replace myEnv* by your virtual environment name
Once you are inside the virtual environment, install Bootstrap 5 with this command:
pip install django-bootstrap-v5
you should get something like this
inside your terminal type
pip freeze > requirements.txt
update your settings.py and add bootstrap to your apps
now add bootstrap style to your master template
What is a master template ?
add these 3 lines in your html head
{% load bootstrap5 %}
{% bootstrap_css %}
{% bootstrap_javascript %}
Bravo, you've been added Bootstrap5 in your project.
Top comments (0)