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