장고 템플릿을 알아보겠습니다.
아래와 같이 base.html이라고 만들어보고
base.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Home</title>
<style>
*{
margin: 0px;
padding: 0px;
}
#main {
width: 100%;
height: 50vh;
background-image: url("https://cdn.inflearn.com/public/main_sliders/77f4ddac-1378-46f2-bf69-dd64c71d05e4/__________01.jpg");
background-size: cover;
}
nav {
width: 100%;
height: 80px;
background-color: white;
line-height: 80px;
}
nav img {
margin-top: 25px;
margin-left: 30px;
}
nav ul {
float: right;
margin-right: 30px;
}
nav ul li {
list-style-type: none;
display: inline-block;
}
nav ul li a {
text-decoration: none;
color: green;
padding: 30px;
}
</style>
</head>
<body>
<div id="main">
<nav>
<img src="https://cdn.inflearn.com/public/files/pages/da35da48-52a5-4ec6-b8d3-0389a47610ec/logo1.png" width="150">
<ul>
<li><a href="#">메뉴</a> </li>
<li><a href="#">메뉴</a> </li>
<li><a href="#">메뉴</a> </li>
<li><a href="#">메뉴</a> </li>
<li><a href="#">메뉴</a> </li>
</ul>
</nav>
</div>
{% block content %}
{% endblock %}
</body>
</html>
home_list.html
{% extends 'blog/base.html' %}
{% block content %}
나의 사이트입니다 WoW
{{ texts }}
{% endblock %}
'인프런 - 강의 > Django 튜토리얼' 카테고리의 다른 글
10 - Django 부트스트랩으로 꾸미기 (0) | 2020.09.21 |
---|---|
9 - Django image upload (0) | 2020.09.21 |
7 - Django query (0) | 2020.09.17 |
6 - Django ckeditor (0) | 2020.09.17 |
5 - Django admin 글 쓰기 (0) | 2020.09.16 |