报错截图
按照如下步骤解决:
1、补充一个安装包
pip install django-crispy-forms
pip install crispy-bootstrap4
2、给INSTALLED_APPS新增一项
INSTALLED_APPS = [
...,
'crispy_forms',
'crispy_bootstrap4',
]
3、给settings.py中添加配置项
CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap4"
CRISPY_TEMPLATE_PACK = "bootstrap4"