Django安装django-bootstrap3库


命令行安装django-bootstrap3库

pip install django-bootstrap3

配置文件settings.py设置

INSTALLED_APPS = [
	...
	# 第三方应用程序
    'bootstrap3'
]
### 安装jquery文件
BOOTSTRAP3 = {
    'include_jquery':True,
}

网页中加载bootstrap3的js,css文件

{% load bootstrap3 %}
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Bootstrap Learning</title>
    {% bootstrap_css %}
    {% bootstrap_javascript %}
</head>
<body>
	<div class="page-header">
		<h1>
			Example page header 
			<small>Subtext for header</small>
		</h1>
	</div>
</body>
</html>


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM