添加Bootstrap 4组件作为插件。
项目描述
django CMS Bootstrap 4 是一个插件包,为django CMS提供来自流行的Bootstrap 4库的几个组件。
为该项目贡献力量,赢得奖励
由于这是一个开源项目,我们欢迎每个人参与 项目 并 为其贡献获得奖励。成为我们出色社区的一员,帮助我们打造世界上最优秀的 CMS。
我们非常乐意接收您以问题报告和拉取请求形式提供的反馈。在提交您的拉取请求之前,请查阅我们的 贡献指南。
项目使用 git 预提交钩子来维护代码质量。请按照安装步骤在您的开发环境中设置 pre-commit。
我们感谢所有帮助创建和维护此包的贡献者。贡献者名单位于 贡献者 部分。
文档
有关其他依赖项,请参阅 setup.py 文件中的 REQUIREMENTS
Django Filer 1.7 或更高版本
Django Text CKEditor 3.1 或更高版本
确保已正确安装和配置 django Filer 和 django CMS Text CKEditor。
安装
手动安装
运行 pip install djangocms-bootstrap4
将以下条目添加到您的 INSTALLED_APPS
'djangocms_icon', 'djangocms_link', 'djangocms_picture', 'djangocms_bootstrap4', 'djangocms_bootstrap4.contrib.bootstrap4_alerts', 'djangocms_bootstrap4.contrib.bootstrap4_badge', 'djangocms_bootstrap4.contrib.bootstrap4_card', 'djangocms_bootstrap4.contrib.bootstrap4_carousel', 'djangocms_bootstrap4.contrib.bootstrap4_collapse', 'djangocms_bootstrap4.contrib.bootstrap4_content', 'djangocms_bootstrap4.contrib.bootstrap4_grid', 'djangocms_bootstrap4.contrib.bootstrap4_jumbotron', 'djangocms_bootstrap4.contrib.bootstrap4_link', 'djangocms_bootstrap4.contrib.bootstrap4_listgroup', 'djangocms_bootstrap4.contrib.bootstrap4_media', 'djangocms_bootstrap4.contrib.bootstrap4_picture', 'djangocms_bootstrap4.contrib.bootstrap4_tabs', 'djangocms_bootstrap4.contrib.bootstrap4_utilities',
运行 python manage.py migrate
代码插件使用 ace 代码编辑器,默认情况下从 CDN 加载。如果您希望 ace 代码编辑器从静态文件提供服务,请在您的需求或 pip 中使用 djangocms-bootstrap4[static-ace] 而不是 djangocms-bootstrap4。通过将 djangocms_static_ace 添加到项目 INSTALLED_APPS 中,使 ace 代码编辑器的静态文件可供项目使用。
配置
django CMS Bootstrap 4 使用 以下 django CMS 插件
它提供了以下 标准 Bootstrap 4 组件
django CMS Bootstrap 4 不会 将样式或 JavaScript 文件添加到您的前端,这些需要您自行添加。
设置
django CMS Bootstrap 4 有多种设置,目前可以更改的如下
DJANGOCMS_BOOTSTRAP4_TAG_CHOICES = ['div', 'section', 'article', 'header', 'footer', 'aside']
DJANGOCMS_BOOTSTRAP4_CAROUSEL_TEMPLATES = (
('default', _('Default')),
)
DJANGOCMS_BOOTSTRAP4_GRID_SIZE = 12
DJANGOCMS_BOOTSTRAP4_GRID_CONTAINERS = (
(_('Default'), (
('container', _('Container')),
('container-fluid', _('Fluid container')),
)),
(_('Custom'), (
('container-yours', _('Your container')),
)),
)
DJANGOCMS_BOOTSTRAP4_GRID_COLUMN_CHOICES = (
('col', _('Column')),
('w-100', _('Break')),
('', _('Empty'))
)
DJANGOCMS_BOOTSTRAP4_USE_ICONS = True
DJANGOCMS_BOOTSTRAP4_TAB_TEMPLATES = (
('default', _('Default')),
)
DJANGOCMS_BOOTSTRAP4_SPACER_SIZES = (
('0', '* 0'),
('1', '* .25'),
('2', '* .5'),
('3', '* 1'),
('4', '* 1.5'),
('5', '* 3'),
)
DJANGOCMS_BOOTSTRAP4_CAROUSEL_ASPECT_RATIOS = (
(16, 9),
)
DJANGOCMS_BOOTSTRAP4_COLOR_STYLE_CHOICES = (
('primary', _('Primary')),
('secondary', _('Secondary')),
('success', _('Success')),
('danger', _('Danger')),
('warning', _('Warning')),
('info', _('Info')),
('light', _('Light')),
('dark', _('Dark')),
('custom', _('Custom')),
)
请注意,此包不支持 djangocms-text-ckeditor 的 拖放图片,因此请确保设置 TEXT_SAVE_IMAGE_FUNCTION = None。
运行测试
您可以通过执行以下命令来运行测试
virtualenv env source env/bin/activate pip install -r tests/requirements/djNN_cmsNN.txt # where NN is an available appropriate version python setup.py test
要运行前端,请确保使用 node 10.x。
项目详情
下载文件
下载适用于您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。
源代码发行版
构建发行版
哈希值 for djangocms_bootstrap4-3.0.2-py3-none-any.whl
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | 3b7e7eb1b7551cf433bf2bb0f3601d47645203c3bb4ad75ec097eb4bd81a34cf |
|
| MD5 | eb572d3beb0be903cf6251c8a3f28e2b |
|
| BLAKE2b-256 | b91e9583fdcb2611152498411aeedc3e53abdb90b05edbf10c7302c343c5f879 |