# Collapsible Sidebar Using Bootstrap for Django
*Collapsible Sidebar Using Bootstrap* is a base template with a bootstrap simple
customization in self-hosted mode (non-CDN).
Features:
- Bootstrap 5.3
- Django 4
- Included demo at [example folder](example)
- Templates included:
- bootstrap_base.html
- snippets/show_err.html
- snippets/show_messages.html
- Templates overridden:
- registration/login.html
- registration/password_change_form.html
- 403.html
- 404.html
- 500.html
- Bootstrap customization available at bootstrap-theme directory.
- Custom font from google-fonts in local static files.
Bootstrap theme and fonts are customizable using scripts included. See details
[bellow](#customize-bootstrap-theme).
## Testing templates with example/demo
An example is included in the [example folder](example) with a Makefile to
initialize the project and preview the templates. More details in
[example/README](example/README.md)
## Template preview


## Installation
The preferred way to install is via pip
pip3 install django-bootstrap-sidebar
but you can install in develop mode cloning this repo but static files are not
included in the repo. See *Customize bootstrap theme section* for details.
After installing your Django instance in `settings.py`, add `bootstrapsidebar`
before `django.contrib.auth` since some auth templates are overridden.
```python
INSTALLED_APPS = [
'bootstrapsidebar'
'django.contrib.auth',
...
]
```
## Blocks available in page layout
The base template (`bootstrap_base.html`) includes the following hierarchical
blocks:
- *block custom-css*
- *block head*
- *block page-wrapper*: to override full page, included sidebar.
- *block sidebar*
- *block navbar*: to override top navbar
- *navbar-links*: only to add links in default template navbar.
- *block messages*: by default this block uses `snippets/show_messages.html`
- *block content*
- *block footer*
- *block after-bootstrap-js*: used to run extra javascript like to enable
Bootstrap Popovers. [See below details](#enable-bootstrap-popovers)
The `registration/login.html` is an example of page using base-template without
sidebar.
## Customize bootstrap theme
Install the package in dev mode is recommended if you want to customize the
Bootstrap Theme. First clone this repo and install in dev mode:
pip install -e ./django-bootstrap-sidebar
Bootstrap static files and fonts are not included in the repo. They are
generated/downloaded with the commands of makefile but the *node* environment
and `npm` are required.
Bootstrap can be customized at file `bootstrap-theme/custom.scss`. An easy way
to create a new customization is some online theme builder
like <https://bootstrap.build/> and download the *custom.scss*.
To generate/upgrade static files makefile automates the process, run make:
make
## Enable Bootstrap Popovers
Due performance reasons popovers are not default enabled. One way is to enable
popovers everywhere, which requires an extra javascript after the Bootstrap
javascript. The last solution is not optimal, but it is a simple way, a detailed
instructions are available at [Bootstrap
Popovers](https://getbootstrap.com/docs/5.2/components/popovers/)
The block `after-bootstrap-js` is intended to enable popovers and
the following code snippet from Bootstrap can be used:
```html
{% block after-bootstrap-js %}
<script>
const popoverTriggerList = document.querySelectorAll('[data-bs-toggle="popover"]')
const popoverList = [...popoverTriggerList].map(popoverTriggerEl => new bootstrap.Popover(popoverTriggerEl))
</script>
{% endblock %}
```
A full example is included in the example folder in page
[popovers.html](example/app/templates/popovers.html)
## License
The project is licensed under the Apache 2.0 license.
## Author
Developed and maintained by Paulino Ruiz de Clavijo Vázquez <pruiz@us.es>
Raw data
{
"_id": null,
"home_page": "https://github.com/paulino/django-bootstrap-sidebar",
"name": "django-bootstrap-sidebar",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "Paulino Ruiz de Clavijo V\u00e1zquez",
"author_email": "pruiz@us.es",
"download_url": "https://files.pythonhosted.org/packages/04/3e/47153677739eda885af12542ea261695bc91d9a465107b4fb0ed23a5ff78/django_bootstrap_sidebar-1.2.5.tar.gz",
"platform": null,
"description": "# Collapsible Sidebar Using Bootstrap for Django\n\n*Collapsible Sidebar Using Bootstrap* is a base template with a bootstrap simple\ncustomization in self-hosted mode (non-CDN).\n\nFeatures:\n\n- Bootstrap 5.3\n- Django 4\n- Included demo at [example folder](example)\n- Templates included:\n - bootstrap_base.html\n - snippets/show_err.html\n - snippets/show_messages.html\n- Templates overridden:\n - registration/login.html\n - registration/password_change_form.html\n - 403.html\n - 404.html\n - 500.html\n- Bootstrap customization available at bootstrap-theme directory.\n- Custom font from google-fonts in local static files.\n\nBootstrap theme and fonts are customizable using scripts included. See details\n[bellow](#customize-bootstrap-theme).\n\n## Testing templates with example/demo\n\nAn example is included in the [example folder](example) with a Makefile to\ninitialize the project and preview the templates. More details in \n[example/README](example/README.md)\n\n## Template preview\n\n\n\n\n\n\n## Installation\n\nThe preferred way to install is via pip\n\n pip3 install django-bootstrap-sidebar\n\nbut you can install in develop mode cloning this repo but static files are not\nincluded in the repo. See *Customize bootstrap theme section* for details.\n\nAfter installing your Django instance in `settings.py`, add `bootstrapsidebar`\nbefore `django.contrib.auth` since some auth templates are overridden.\n\n```python\nINSTALLED_APPS = [\n 'bootstrapsidebar'\n 'django.contrib.auth',\n ...\n]\n```\n\n## Blocks available in page layout\n\nThe base template (`bootstrap_base.html`) includes the following hierarchical\nblocks:\n\n- *block custom-css*\n- *block head*\n- *block page-wrapper*: to override full page, included sidebar.\n - *block sidebar*\n - *block navbar*: to override top navbar\n - *navbar-links*: only to add links in default template navbar.\n - *block messages*: by default this block uses `snippets/show_messages.html`\n - *block content*\n - *block footer*\n- *block after-bootstrap-js*: used to run extra javascript like to enable\n Bootstrap Popovers. [See below details](#enable-bootstrap-popovers)\n\nThe `registration/login.html` is an example of page using base-template without\nsidebar.\n\n## Customize bootstrap theme\n\nInstall the package in dev mode is recommended if you want to customize the\nBootstrap Theme. First clone this repo and install in dev mode:\n\n pip install -e ./django-bootstrap-sidebar\n\nBootstrap static files and fonts are not included in the repo. They are\ngenerated/downloaded with the commands of makefile but the *node* environment\nand `npm` are required.\n\nBootstrap can be customized at file `bootstrap-theme/custom.scss`. An easy way\nto create a new customization is some online theme builder\nlike <https://bootstrap.build/> and download the *custom.scss*.\n\nTo generate/upgrade static files makefile automates the process, run make:\n\n make\n\n## Enable Bootstrap Popovers\n\nDue performance reasons popovers are not default enabled. One way is to enable\npopovers everywhere, which requires an extra javascript after the Bootstrap\njavascript. The last solution is not optimal, but it is a simple way, a detailed\ninstructions are available at [Bootstrap\nPopovers](https://getbootstrap.com/docs/5.2/components/popovers/)\n\nThe block `after-bootstrap-js` is intended to enable popovers and\nthe following code snippet from Bootstrap can be used:\n\n```html\n{% block after-bootstrap-js %}\n<script>\nconst popoverTriggerList = document.querySelectorAll('[data-bs-toggle=\"popover\"]')\nconst popoverList = [...popoverTriggerList].map(popoverTriggerEl => new bootstrap.Popover(popoverTriggerEl))\n</script>\n{% endblock %}\n```\n\nA full example is included in the example folder in page \n[popovers.html](example/app/templates/popovers.html)\n\n## License\n\nThe project is licensed under the Apache 2.0 license.\n\n## Author\n\nDeveloped and maintained by Paulino Ruiz de Clavijo V\u00e1zquez <pruiz@us.es>\n",
"bugtrack_url": null,
"license": null,
"summary": "Bootstrap 5.3 template for django 4",
"version": "1.2.5",
"project_urls": {
"Bug Tracker": "https://github.com/paulino/django-bootstrap-sidebar/issues",
"Changelog": "https://github.com/paulino/django-bootstrap-sidebar/blob/master/CHANGELOG.md",
"GitHub": "https://github.com/paulino/django-bootstrap-sidebar/",
"Homepage": "https://github.com/paulino/django-bootstrap-sidebar"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "03e453cea0e311322d13272457ffb1f483b184372e23836d154b27fb1e94b720",
"md5": "3669d4c4748a2c0c4dd78cb6d6e472e1",
"sha256": "338f909cf0dca7d4e727ede65e36607a94f20d850573d4d00e14dd40fc2a8b0e"
},
"downloads": -1,
"filename": "django_bootstrap_sidebar-1.2.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3669d4c4748a2c0c4dd78cb6d6e472e1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 293578,
"upload_time": "2024-09-07T14:13:43",
"upload_time_iso_8601": "2024-09-07T14:13:43.957208Z",
"url": "https://files.pythonhosted.org/packages/03/e4/53cea0e311322d13272457ffb1f483b184372e23836d154b27fb1e94b720/django_bootstrap_sidebar-1.2.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "043e47153677739eda885af12542ea261695bc91d9a465107b4fb0ed23a5ff78",
"md5": "278bc70b8a9224ecbdc2cdd178ec60e6",
"sha256": "2a025a48baacc7a25e1a07e768261e6826d93a8918506194220b5a8e720ff7d8"
},
"downloads": -1,
"filename": "django_bootstrap_sidebar-1.2.5.tar.gz",
"has_sig": false,
"md5_digest": "278bc70b8a9224ecbdc2cdd178ec60e6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 290262,
"upload_time": "2024-09-07T14:13:46",
"upload_time_iso_8601": "2024-09-07T14:13:46.244769Z",
"url": "https://files.pythonhosted.org/packages/04/3e/47153677739eda885af12542ea261695bc91d9a465107b4fb0ed23a5ff78/django_bootstrap_sidebar-1.2.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-07 14:13:46",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "paulino",
"github_project": "django-bootstrap-sidebar",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "django-bootstrap-sidebar"
}