Django Bootstrap Integration
A CSS framework can provide common presentation classes, but Django does not require Bootstrap and does not install it automatically. Keep asset versions and licences explicit.
How it works
Bhylu already hosts licensed Bootstrap 5.3.8 assets for its Bootstrap course. For this optional lab, download the provided CSS into static/vendor/bootstrap.min.css and retain its licence beside it, then link it through the static tag in base.html. The supplied workshop application keeps its own CSS by default. Plugin interactions would also need the matching JavaScript bundle; a class name alone does not implement a modal or dropdown.
Run in the supplied local Django project
This lesson uses Django 5.2.18 LTS with Python 3.12. Download the source downloader and run node download-project.mjs http://127.0.0.1:8000 with Node 22 while previewing locally. It creates a new bhylu-django-lab folder and refuses to overwrite an existing one. After deployment, the default base is bhylu.com; until then use your local preview URL.
Inside that new folder, create a virtual environment, install requirements.txt and run the complete lesson file shown below. Every lesson creates a fresh in-memory SQLite database and temporary upload storage. It does not edit the interactive lab’s db.sqlite3 or Bhylu’s database. The visible listing below is the lesson’s core code; its complete downloaded file includes the shared bootstrap.
Django does not run in Bhylu’s current browser playground. No Apache, MySQL or global PHP configuration change is needed. See the setup lesson for the full project and commands.
Example
Run .venv\Scripts\python.exe lessons\bootstrap.py from the downloaded project root. Download the complete lesson file; keep it under lessons/. The project’s shared models, forms, views and fixture are prerequisites, not a hidden online runtime.
from django.template import Context, Template
markup = Template('<button type="submit" class="btn btn-primary">{{ label }}</button>')
print(markup.render(Context({"label":"Reserve seats"})))
Expected result
<button type="submit" class="btn btn-primary">Reserve seats</button>
The rendered button demonstrates semantic markup and framework classes. This example tests template output only; Bootstrap styling requires the separate documented asset copy. The plain lab remains usable without that optional framework.
Optional CSS download: Bootstrap 5.3.8 CSS. Preserve its licence with copied assets. The default project does not enable Bootstrap.
Use Django’s versioned official documentation for exact API contracts and the deployment checklist before a separate release.