bootstrap add django code example

Example 1: bootstrap python django

pip install django-bootstrap4

Example 2: django bootstrap where to put the files

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{% block title %}title{% endblock %}</title>

    {% load staticfiles %}
    <!-- Bootstrap -->
    <link href="{% static "bower_components/bootstrap/dist/css/bootstrap.css" %}" rel="stylesheet">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>
    {% block content %}
    {% endblock %}

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="{% static "bower_components/jquery/dist/jquery.min.js" %}"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="{% static "bower_components/bootstrap/dist/js/bootstrap.min.js" %}"></script>
  </body>
</html>

Tags:

Html Example