添加引导4组件作为插件。
djangocms-bootstrap4的Python项目详细描述
django cms bootstrap 4是django cms的插件包,提供了几个 流行的Bootstrap 4库中的组件。
此加载项与Divio Cloud兼容,也可以在 django CMS Marketplace 便于安装。
贡献
这是一个开源项目。我们很高兴收到您的 以问题和请求的形式提供反馈。在提交您的 拉动请求,请查看我们的contribution guidelines。
我们感谢所有帮助创建和维护此软件包的贡献者。 贡献者列在contributors 章节。
你能做的最简单的贡献之一就是帮助翻译这个插件 Transifex。
文档
参见setup.py中的REQUIREMENTS。 其他依赖项的文件:
- django filer 1.2.4或更高版本
- django text ckeditor 3.1.0或更高版本
- Django CMS图标1.0.0或更高版本
- Django CMS Link 2.1.0或更高版本
- Django CMS图片2.1.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
配置
django cms bootstrap 4使用以下django cms插件:
它提供以下标准引导4组件:
- Alerts
- Badge
- Card
- Carousel
- Collapse
- Content (Blockquote, Code, Figure)
- Grid (Container, Row, Column)
- Jumbotron
- Link / Button
- List group
- Media
- Picture / Image
- Tabs
- Utilities (Spacing)
设置
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 = ( ('container', _('Container')), ('container-fluid', _('Fluid 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')), )
请参阅他们的代码参考以了解更多详细信息。
运行测试
您可以执行以下操作来运行测试:
virtualenv env source env/bin/activate pip install -r tests/requirements.txt python setup.py test