This document provides the instructions on how to install the Bootstrap5 theme for Django-Cast. Please follow the steps below.
To install the Bootstrap5 theme, you will need to run the following command in your command line:
pip install cast-bootstrap5
You will need to add crispy_bootstrap5
and cast_bootstrap5.apps.CastBootstrap5Config
to your INSTALLED_APPS in your Django settings. Also, if crispy_forms
is not
yet added, add it to INSTALLED_APPS.
Then, set the CRISPY_TEMPLATE_PACK and CRISPY_ALLOWED_TEMPLATE_PACKS like so:
INSTALLED_APPS = [
...,
'crispy_forms',
'crispy_bootstrap5',
'cast_bootstrap5.apps.CastBootstrap5Config',
...
]
CRISPY_TEMPLATE_PACK = "bootstrap5"
CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5"
You can set the theme to bootstrap5
in the Wagtail admin for the
complete site or just one blog.
That's it! You have successfully installed and set up the Bootstrap5 theme
for django-cast
.
All javascript stuff lives in the javascript
folder. So the first thing
to do is to change to that folder.
cd javascript
Then install the dependencies:
npm install
npx vite build
After that you have to copy the contents of the dist
folder
to the cast_bootstrap5/static/cast_bootstrap5/vite
folder. Including
the manifest file from dist/.vite/manifest.json
.
cp dist/* ../cast_bootstrap5/static/cast_bootstrap5/vite
cp dist/.vite/manifest.json ../cast_bootstrap5/static/cast_bootstrap5/vite
npx vitest run # run tests once
npx vitest watch # run tests on file changes
npx vite