一个django插件,用于在引导模式下创建ajax驱动的表单。
django-bootstrap-modal-forms的Python项目详细描述
安装
安装django引导模式窗体
$ pip install django-bootstrap-modal-forms
在"设置"中将引导模式表单添加到已安装的应用程序中。py:
INSTALLED_APPS = [ ... 'bootstrap_modal_forms', ... ]
包括bootstrap、jquery和jquery.bootstrap.modal.forms.js在您希望在bootstrap modal中设置ajax驱动的django表单的每个页面上。
< > >
重要提示:调整引导和jquery文件路径以匹配您的路径,但要包含jquery.bootstrap.modal.forms.js与下面的代码完全相同。
<head><linkrel="stylesheet"href="{%static'assets/css/bootstrap.css'%}"></head><body><scriptsrc="{%static'assets/js/bootstrap.js'%}"></script><scriptsrc="{%static'assets/js/jquery.js'%}"></script><scriptsrc="{%static'js/jquery.bootstrap.modal.forms.js'%}"></script><!-- You can alternatively load the minified version --><scriptsrc="{%static'js/jquery.bootstrap.modal.forms.min.js'%}"></script></body>