Django Tutorial
About Lesson

In this Django Tutorial we are going to talk about Django Bootstrap Styles, we have learned that how you can add CSS styles in your django project, now we want to learn adding bootstrap styles in our django project, so Bootstrap is a free and open-source CSS framework directed at responsive, mobile-first front-end web development. It contains CSS- and JavaScript-based design templates for typography, forms, buttons, navigation, and other interface components.

 

There are two ways that you can add boostrap styles in your django project, the first way is that you can simply download the files and add that in your static folder, after that connect the files in your base.html. the second way is that you can easily copy the bootstrap CDNLinks and add that in your base.html, as we want to do that in this lesson.

 

 

Now this is our base.html and we have added our CSS and JavaScript links, also i want to add a navbar for my website.

 

mysite/templates/base.html

 

 

 

These are our other files.

 

mysite/templates/index.html

 

 

 

mysite/static/style.css

 

 

 

mysite/polls/views.py

 

 

mysite/polls/models.py

 

 

 

mysite/polls/urls.py

 

 

mysite/urls.py

 

 

 

Run the complete code and you can see that we have a nice navbar, and this navbar is taken from bootstrap.

Django Tutorial - Django Bootstrap Styles
Django Tutorial – Django Bootstrap Styles