In-Class Activity 10: Django with Bootstrap:

Objective: Learn how to use the Bootstrap CSS Framework and Bootswatch themes to style your web app.

Description: Use django-bootstrap5 and apply a Bootswatch theme to style both the base.html and index.html templates.

  • Make a copy of your Activity9 folder and name the folder Activity10-DjangoWithBootstrap. After the activity is completed, take one screenshot that matches the solution image below from Part 2 and submit it to the first quiz question on Canvas.
  • Navigate to the directory that contains manage.py and open the folder in VS code.

Part 1: Applying Bootstrap

  1. Once the django-bootstrap5 app is installed, (already installed on VCAT) add the app to the settings.py file.
  2. Modify the base.html file and define the HTML headers and navigation bar headers.
  3. Modify the index.html file to include the page header block.
  • Once completed, the index page should look similar to the below:

Code Journal page centered on the Dictionaries topic with breadcrumb navigation at the top and a saved entry listed below the Entries heading. The visible interface emphasizes the topic content and the newly saved note, demonstrating where learners review what they entered. The environment is a minimal browser page with plain styling and strong text contrast, creating an organized and calm tone for reading study notes.


Part 2: Applying a Bootswatch theme (This will be demo’d in class. An instructional video covering Part 2 is also available to reference in the Bootswatch Themes section of our course notebook.)

  1. Apply a Bootswatch theme to your application from https://bootswatch.com
  2. Modify the navigation bar to add a drop down menu to display links to the new_topic.html and bar_chart.html pages.
  3. Use the bootswatch source code to further customize the element in index.html.
  • Once completed, the index page should look similar to the below, depending on the Bootswatch theme you’ve chosen:

Vapor Theme Code Journal topics page showing a list of topic links with adjacent delete links so a user can remove a selected topic. The interface demonstrates the delete action in context and supports quick topic management from one screen. The wider environment is a straightforward browser page used in a local class project, with a clean background, simple text links, and an efficient practical tone.


Journal Theme Code Journal topics page showing a list of topic links with adjacent delete links so a user can remove a selected topic. The interface demonstrates the delete action in context and supports quick topic management from one screen. The wider environment is a straightforward browser page used in a local class project, with a clean background, simple text links, and an efficient practical tone.