質問編集履歴

1

layout.htmlの追加

2021/09/14 14:00

投稿

akane_emo
akane_emo

スコア30

test CHANGED
File without changes
test CHANGED
@@ -116,7 +116,105 @@
116
116
 
117
117
 
118
118
 
119
+ ```
120
+
121
+ python template layout.html
122
+
123
+
124
+
125
+ {% load static %}
126
+
127
+ <!DOCTYPE html>
128
+
129
+ <html lang="ja">
130
+
131
+
132
+
133
+ <head>
134
+
135
+ <!-- Required meta tags always come first -->
136
+
137
+ <meta charset="utf-8">
138
+
139
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
140
+
141
+ <meta http-equiv="x-ua-compatible" content="ie=edge">
142
+
143
+ <title>{% block title %}{% endblock %}</title>
144
+
145
+ <!-- Bootstrap CSS -->
146
+
147
+ <link rel="stylesheet"
148
+
149
+ href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
150
+
151
+ crossorigin="anonymous">
152
+
153
+ </head>
154
+
155
+
156
+
157
+ <body class="container">
158
+
159
+ <nav class="navbar navbar-expand-lg navbar-light bg-light">
160
+
161
+ <ul class="navbar ml-auto">
162
+
163
+ <span>logind: <span class="h6">{{login_user}}</span></span>
164
+
165
+ </ul>
166
+
167
+ </nav>
168
+
169
+
170
+
171
+ <div>{% block header %}
172
+
173
+ {% endblock header %}
174
+
175
+ </div>
176
+
177
+
178
+
179
+ <div class="content">{% block content %}
180
+
181
+ {% endblock content %}
182
+
183
+ </div>
184
+
185
+
186
+
187
+ <hr>
188
+
189
+ <div class="my-3">
190
+
191
+ <span class-"font-weight-bold">
192
+
193
+ <a href="/admin/logout?next=/">
194
+
195
+ [ logout ]<a>
196
+
197
+ </span>
198
+
199
+ </div>
200
+
201
+
202
+
203
+ </body>
204
+
205
+
206
+
207
+ </html>
208
+
209
+
210
+
211
+ ```
212
+
213
+ ```
214
+
119
- ```python template index.html
215
+ python template index.html
216
+
217
+
120
218
 
121
219
  {% block content %}
122
220