DJANGO – 12 ADDING BOOTSTRAP TO DJANGO

Spread the love

1. Download or copy the content of the bootstrap template you want to use from this following URL: https://getbootstrap.com/docs/4.4/examples/

https://getbootstrap.com/docs/4.4/examples/

1. Click on one example: We will use (Navbar Fixed),

2. Right-clink it and select view page source and save/copy the content in your template folder and name it home.html.

3. Load the static files with {% load staticfiles %} in the page.

4. Download all CSS, JS associated with the bootstrap framework you are using into your CSS, JS folder.
Example:
bootstrap.min.css, navbar-fixed-top.css

5. Use the following to link css to your page:
<link href="{% static 'css/fileName.css' %}" rel="stylesheet">

6. Use the following to link js files to your page:
<script src="{% static 'js/fileName.js' %}"></script>

7. Make a bootstrap row and button:

<div class="row">
	<div class="col-sm-3"> <!--(col-sm-3, col-sm-6, col-sm-12)-->
		<input class='btn btn-primary' type='submit' value='Save'/>
	</div>
</div>

Spread the love

About the author

arbadjie

Hi, I'm Abdourahman Badjie, an aspiring developer with obsession for anything coding and networking. This blog is dedicated to helping people learn to develop web applications using django framework.

View all posts

Leave a Reply

Your email address will not be published. Required fields are marked *