質問編集履歴
8
2
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ドメインを取得し
|
1
|
+
ドメインを取得し独立したHTMLを表示可能か知りたい
|
test
CHANGED
@@ -1,16 +1,6 @@
|
|
1
1
|
https://hoge.com/templates/index.html
|
2
2
|
|
3
|
-
https://hoge.com/templates/no2.htmlというURLを
|
3
|
+
https://hoge.com/templates/no2.htmlというURLを表示させたい。
|
4
|
-
|
5
|
-
django初日です。
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
プロジェクト名:project
|
10
|
-
|
11
|
-
アプリケーション名:app
|
12
|
-
|
13
|
-
というdjangoを導入しHTMLを表示したいです。
|
14
4
|
|
15
5
|
|
16
6
|
|
@@ -30,287 +20,7 @@
|
|
30
20
|
|
31
21
|
Request URL: http://xxx.xxx/templates/index.html
|
32
22
|
|
33
|
-
Using the URLconf defined in project.urls,
|
23
|
+
Using the URLconf defined in project.urls,
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
admin/
|
38
|
-
|
39
|
-
[name='index']
|
40
|
-
|
41
|
-
The current path, templates/index.html, didn't match any of these.
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
```
|
50
|
-
|
51
|
-
#エラー no2.html
|
52
|
-
|
53
|
-
```ここに言語を入力
|
54
|
-
|
55
|
-
Page not found (404)
|
56
|
-
|
57
|
-
Request Method: GET
|
58
|
-
|
59
|
-
Request URL: http://xxx.xxx/templates/no2.html
|
60
|
-
|
61
|
-
Using the URLconf defined in project.urls, Django tried these URL patterns, in this order:
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
admin/
|
66
|
-
|
67
|
-
[name='index']
|
68
|
-
|
69
|
-
The current path, templates/no2.html, didn't match any of these.
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
```
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
admin/
|
84
|
-
|
85
|
-
[name='index']
|
86
|
-
|
87
|
-
The current path, no2.html, didn't match any of these.
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
サーバと独自ドメインはhoge.comをすでに用意しその中にdjangoを入れています。ロケットは既に見えてます。
|
94
|
-
|
95
|
-
webサーバはnginxを立ててます。以下のようなディレクトリ構成です。
|
96
|
-
|
97
|
-
```ここに言語を入力
|
98
|
-
|
99
|
-
home
|
100
|
-
|
101
|
-
-djangouser
|
102
|
-
|
103
|
-
-hoge.com
|
104
|
-
|
105
|
-
-manage.py
|
106
|
-
|
107
|
-
-project
|
108
|
-
|
109
|
-
-urls.py➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡今回修正--1
|
110
|
-
|
111
|
-
-app
|
112
|
-
|
113
|
-
-static_sites
|
114
|
-
|
115
|
-
-urls.py➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡今回追加--2
|
116
|
-
|
117
|
-
-views.py➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡今回追加--3
|
118
|
-
|
119
|
-
-templates
|
120
|
-
|
121
|
-
-index.html➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡今回追加--4
|
122
|
-
|
123
|
-
-no2.html➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡今回追加--5
|
124
|
-
|
125
|
-
```
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
上記の5ファイルについて作成・追記を行いましたがsysctlやrunserverを実施してもhtmlが見れません。
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
#urls.py➡プロジェクト➡➡➡➡➡➡今回修正--1
|
134
|
-
|
135
|
-
```
|
136
|
-
|
137
|
-
from django.contrib import admin
|
138
|
-
|
139
|
-
from django.urls import path, include
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
urlpatterns = [
|
144
|
-
|
145
|
-
path('admin/', admin.site.urls),
|
146
|
-
|
147
|
-
path('templates/', include('static_sites.urls')),
|
148
|
-
|
149
|
-
]
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
```
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
#-urls.py➡static_sites➡➡➡➡➡➡今回追加--2
|
158
|
-
|
159
|
-
```
|
160
|
-
|
161
|
-
from django.urls import path
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
from . import views
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
urlpatterns = [
|
170
|
-
|
171
|
-
path('', views.index, name='index'),
|
172
|
-
|
173
|
-
path('index', views.show_index, name='show_index'),
|
174
|
-
|
175
|
-
path('no2', views.show_no2, name='show_no2'),
|
176
|
-
|
177
|
-
]
|
178
|
-
|
179
|
-
```
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
#views.py➡static_sites➡➡➡➡➡➡今回追加--3
|
184
|
-
|
185
|
-
```
|
186
|
-
|
187
|
-
from django.shortcuts import render
|
188
|
-
|
189
|
-
from django.http import HttpResponse
|
190
|
-
|
191
|
-
from django.shortcuts import render
|
192
|
-
|
193
|
-
# Create your views here.
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
def index(request):
|
200
|
-
|
201
|
-
return HttpResponse("Hello")
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
def show_index(request):
|
208
|
-
|
209
|
-
return render(request, 'index.html')
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
def show_no2(request):
|
216
|
-
|
217
|
-
return render(request, 'no2.html')
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
```
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
#-index.html➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡今回追加--4
|
226
|
-
|
227
|
-
```
|
228
|
-
|
229
|
-
<!DOCTYPE html>
|
230
|
-
|
231
|
-
<html lang="en">
|
232
|
-
|
233
|
-
<head>
|
234
|
-
|
235
|
-
<meta charset="UTF-8">
|
236
|
-
|
237
|
-
<title>Title</title>
|
238
|
-
|
239
|
-
</head>
|
240
|
-
|
241
|
-
<body>
|
242
|
-
|
243
|
-
index.html hogegegegegegegegegegegegegegegge
|
244
|
-
|
245
|
-
</body>
|
246
|
-
|
247
|
-
</html>
|
248
|
-
|
249
|
-
```
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
#-no2.html➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡今回追加--5
|
254
|
-
|
255
|
-
```
|
256
|
-
|
257
|
-
<!DOCTYPE html>
|
258
|
-
|
259
|
-
<html lang="en">
|
260
|
-
|
261
|
-
<head>
|
262
|
-
|
263
|
-
<meta charset="UTF-8">
|
264
|
-
|
265
|
-
<title>Title</title>
|
266
|
-
|
267
|
-
</head>
|
268
|
-
|
269
|
-
<body>
|
270
|
-
|
271
|
-
no2.html hogeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
|
272
|
-
|
273
|
-
</body>
|
274
|
-
|
275
|
-
</html>
|
276
|
-
|
277
|
-
```
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
#
|
282
|
-
|
283
|
-
```
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
```
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
どこのフォルダに格納すればURLとして表示されるのでしょうか?通常djangoで処理を噛ませる場合はviewsやappやurlsなどに追加しますが、index.htmlやno2.htmlなど非常に簡単な構造のhtmlです。この場合djangoの連携をせずに単純にURLを叩いて表示させたいです。hoge.com/templates/index.htmlなどURLで表示できないのでしょうか?
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
#ためしたこと
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
templatesフォルダの中に2つのhtmlファイルを格納し
|
308
|
-
|
309
|
-
https://hoge.com/templates/index.html
|
310
|
-
|
311
|
-
https://hoge.com/templates/no2.html
|
312
|
-
|
313
|
-
ブラウザでアクセスしたが見れませんでした。もちろんsysctl、migrate、runserverは実施済です。
|
314
24
|
|
315
25
|
|
316
26
|
|
7
7
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
https://hoge.com/templ
|
1
|
+
https://hoge.com/templates/index.html
|
2
|
-
|
2
|
+
|
3
|
-
https://hoge.com/templ
|
3
|
+
https://hoge.com/templates/no2.htmlというURLをdjango上で表示させたい。
|
4
4
|
|
5
5
|
django初日です。
|
6
6
|
|
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
#やりたいこと
|
18
18
|
|
19
|
-
hoge.com/templ
|
19
|
+
hoge.com/templates/index.html hoge.com/templates/no2.htmlというURLで表示させたい。
|
20
20
|
|
21
21
|
|
22
22
|
|
@@ -28,7 +28,7 @@
|
|
28
28
|
|
29
29
|
Request Method: GET
|
30
30
|
|
31
|
-
Request URL: http://xxx.xxx/templ
|
31
|
+
Request URL: http://xxx.xxx/templates/index.html
|
32
32
|
|
33
33
|
Using the URLconf defined in project.urls, Django tried these URL patterns, in this order:
|
34
34
|
|
@@ -38,7 +38,7 @@
|
|
38
38
|
|
39
39
|
[name='index']
|
40
40
|
|
41
|
-
The current path, templ
|
41
|
+
The current path, templates/index.html, didn't match any of these.
|
42
42
|
|
43
43
|
|
44
44
|
|
@@ -56,7 +56,7 @@
|
|
56
56
|
|
57
57
|
Request Method: GET
|
58
58
|
|
59
|
-
Request URL: http://xxx.xxx/templ
|
59
|
+
Request URL: http://xxx.xxx/templates/no2.html
|
60
60
|
|
61
61
|
Using the URLconf defined in project.urls, Django tried these URL patterns, in this order:
|
62
62
|
|
@@ -66,7 +66,7 @@
|
|
66
66
|
|
67
67
|
[name='index']
|
68
68
|
|
69
|
-
The current path, templ
|
69
|
+
The current path, templates/no2.html, didn't match any of these.
|
70
70
|
|
71
71
|
|
72
72
|
|
@@ -116,7 +116,7 @@
|
|
116
116
|
|
117
117
|
-views.py➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡今回追加--3
|
118
118
|
|
119
|
-
-templ
|
119
|
+
-templates
|
120
120
|
|
121
121
|
-index.html➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡今回追加--4
|
122
122
|
|
@@ -296,7 +296,7 @@
|
|
296
296
|
|
297
297
|
|
298
298
|
|
299
|
-
どこのフォルダに格納すればURLとして表示されるのでしょうか?通常djangoで処理を噛ませる場合はviewsやappやurlsなどに追加しますが、index.htmlやno2.htmlなど非常に簡単な構造のhtmlです。この場合djangoの連携をせずに単純にURLを叩いて表示させたいです。hoge.com/templ
|
299
|
+
どこのフォルダに格納すればURLとして表示されるのでしょうか?通常djangoで処理を噛ませる場合はviewsやappやurlsなどに追加しますが、index.htmlやno2.htmlなど非常に簡単な構造のhtmlです。この場合djangoの連携をせずに単純にURLを叩いて表示させたいです。hoge.com/templates/index.htmlなどURLで表示できないのでしょうか?
|
300
300
|
|
301
301
|
|
302
302
|
|
@@ -304,11 +304,11 @@
|
|
304
304
|
|
305
305
|
|
306
306
|
|
307
|
-
templ
|
307
|
+
templatesフォルダの中に2つのhtmlファイルを格納し
|
308
|
-
|
308
|
+
|
309
|
-
https://hoge.com/templ
|
309
|
+
https://hoge.com/templates/index.html
|
310
|
-
|
310
|
+
|
311
|
-
https://hoge.com/templ
|
311
|
+
https://hoge.com/templates/no2.html
|
312
312
|
|
313
313
|
ブラウザでアクセスしたが見れませんでした。もちろんsysctl、migrate、runserverは実施済です。
|
314
314
|
|
6
5
test
CHANGED
File without changes
|
test
CHANGED
@@ -20,6 +20,76 @@
|
|
20
20
|
|
21
21
|
|
22
22
|
|
23
|
+
#エラー index.html
|
24
|
+
|
25
|
+
```ここに言語を入力
|
26
|
+
|
27
|
+
Page not found (404)
|
28
|
+
|
29
|
+
Request Method: GET
|
30
|
+
|
31
|
+
Request URL: http://xxx.xxx/templetes/index.html
|
32
|
+
|
33
|
+
Using the URLconf defined in project.urls, Django tried these URL patterns, in this order:
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
admin/
|
38
|
+
|
39
|
+
[name='index']
|
40
|
+
|
41
|
+
The current path, templetes/index.html, didn't match any of these.
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
```
|
50
|
+
|
51
|
+
#エラー no2.html
|
52
|
+
|
53
|
+
```ここに言語を入力
|
54
|
+
|
55
|
+
Page not found (404)
|
56
|
+
|
57
|
+
Request Method: GET
|
58
|
+
|
59
|
+
Request URL: http://xxx.xxx/templetes/no2.html
|
60
|
+
|
61
|
+
Using the URLconf defined in project.urls, Django tried these URL patterns, in this order:
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
admin/
|
66
|
+
|
67
|
+
[name='index']
|
68
|
+
|
69
|
+
The current path, templetes/no2.html, didn't match any of these.
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
```
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
admin/
|
84
|
+
|
85
|
+
[name='index']
|
86
|
+
|
87
|
+
The current path, no2.html, didn't match any of these.
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
23
93
|
サーバと独自ドメインはhoge.comをすでに用意しその中にdjangoを入れています。ロケットは既に見えてます。
|
24
94
|
|
25
95
|
webサーバはnginxを立ててます。以下のようなディレクトリ構成です。
|
5
4
test
CHANGED
File without changes
|
test
CHANGED
@@ -74,8 +74,6 @@
|
|
74
74
|
|
75
75
|
path('admin/', admin.site.urls),
|
76
76
|
|
77
|
-
#path('', include('employee.urls')),
|
78
|
-
|
79
77
|
path('templates/', include('static_sites.urls')),
|
80
78
|
|
81
79
|
]
|
4
3
test
CHANGED
File without changes
|
test
CHANGED
@@ -238,13 +238,11 @@
|
|
238
238
|
|
239
239
|
templetesフォルダの中に2つのhtmlファイルを格納し
|
240
240
|
|
241
|
-
hoge.com/templetes/index.html
|
241
|
+
https://hoge.com/templetes/index.html
|
242
|
-
|
242
|
+
|
243
|
-
hoge.com/templetes/no2.html
|
243
|
+
https://hoge.com/templetes/no2.html
|
244
|
-
|
245
|
-
|
246
|
-
|
244
|
+
|
247
|
-
アクセスしたが見れませんでした。
|
245
|
+
ブラウザでアクセスしたが見れませんでした。もちろんsysctl、migrate、runserverは実施済です。
|
248
246
|
|
249
247
|
|
250
248
|
|
3
2
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
https://hoge.com/templetes/index.html
|
2
|
+
|
3
|
+
https://hoge.com/templetes/no2.htmlというURLをdjango上で表示させたい。
|
4
|
+
|
1
5
|
django初日です。
|
2
6
|
|
3
7
|
|
@@ -16,7 +20,7 @@
|
|
16
20
|
|
17
21
|
|
18
22
|
|
19
|
-
サーバと独自ドメインはhoge.comを用意しその中にdjangoを入れています。
|
23
|
+
サーバと独自ドメインはhoge.comをすでに用意しその中にdjangoを入れています。ロケットは既に見えてます。
|
20
24
|
|
21
25
|
webサーバはnginxを立ててます。以下のようなディレクトリ構成です。
|
22
26
|
|
@@ -36,13 +40,13 @@
|
|
36
40
|
|
37
41
|
-app
|
38
42
|
|
39
|
-
-static_sites
|
43
|
+
-static_sites
|
40
44
|
|
41
45
|
-urls.py➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡今回追加--2
|
42
46
|
|
43
47
|
-views.py➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡今回追加--3
|
44
48
|
|
45
|
-
-templetes
|
49
|
+
-templetes
|
46
50
|
|
47
51
|
-index.html➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡今回追加--4
|
48
52
|
|
@@ -52,6 +56,10 @@
|
|
52
56
|
|
53
57
|
|
54
58
|
|
59
|
+
上記の5ファイルについて作成・追記を行いましたがsysctlやrunserverを実施してもhtmlが見れません。
|
60
|
+
|
61
|
+
|
62
|
+
|
55
63
|
#urls.py➡プロジェクト➡➡➡➡➡➡今回修正--1
|
56
64
|
|
57
65
|
```
|
2
全ファイル記載
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,25 +6,13 @@
|
|
6
6
|
|
7
7
|
アプリケーション名:app
|
8
8
|
|
9
|
-
というdjangoを導入した
|
9
|
+
というdjangoを導入しHTMLを表示したいです。
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
|
14
|
-
|
11
|
+
|
12
|
+
|
15
|
-
|
13
|
+
#やりたいこと
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
|
19
|
-
|
15
|
+
hoge.com/templetes/index.html hoge.com/templetes/no2.htmlというURLで表示させたい。
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
まず以下フォルダとディレクトリを用意します。
|
24
|
-
|
25
|
-
フォルダ名:templetes
|
26
|
-
|
27
|
-
folderに入っているhtmlファイル名:index.htmlとno2.html
|
28
16
|
|
29
17
|
|
30
18
|
|
@@ -44,39 +32,139 @@
|
|
44
32
|
|
45
33
|
-project
|
46
34
|
|
35
|
+
-urls.py➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡今回修正--1
|
36
|
+
|
47
37
|
-app
|
48
38
|
|
39
|
+
-static_sites ➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡今回追加
|
40
|
+
|
41
|
+
-urls.py➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡今回追加--2
|
42
|
+
|
43
|
+
-views.py➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡今回追加--3
|
44
|
+
|
49
|
-
|
45
|
+
-templetes➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡今回追加
|
50
|
-
|
46
|
+
|
51
|
-
-index.html
|
47
|
+
-index.html➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡今回追加--4
|
52
|
-
|
48
|
+
|
53
|
-
-no2.html
|
49
|
+
-no2.html➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡今回追加--5
|
54
|
-
|
50
|
+
|
55
|
-
```
|
51
|
+
```
|
52
|
+
|
53
|
+
|
54
|
+
|
56
|
-
|
55
|
+
#urls.py➡プロジェクト➡➡➡➡➡➡今回修正--1
|
56
|
+
|
57
|
-
|
57
|
+
```
|
58
|
+
|
58
|
-
|
59
|
+
from django.contrib import admin
|
60
|
+
|
61
|
+
from django.urls import path, include
|
62
|
+
|
63
|
+
|
64
|
+
|
59
|
-
|
65
|
+
urlpatterns = [
|
66
|
+
|
60
|
-
|
67
|
+
path('admin/', admin.site.urls),
|
68
|
+
|
61
|
-
|
69
|
+
#path('', include('employee.urls')),
|
70
|
+
|
62
|
-
|
71
|
+
path('templates/', include('static_sites.urls')),
|
72
|
+
|
73
|
+
]
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
```
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
#-urls.py➡static_sites➡➡➡➡➡➡今回追加--2
|
82
|
+
|
83
|
+
```
|
84
|
+
|
85
|
+
from django.urls import path
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
from . import views
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
urlpatterns = [
|
94
|
+
|
95
|
+
path('', views.index, name='index'),
|
96
|
+
|
97
|
+
path('index', views.show_index, name='show_index'),
|
98
|
+
|
99
|
+
path('no2', views.show_no2, name='show_no2'),
|
100
|
+
|
101
|
+
]
|
102
|
+
|
103
|
+
```
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
#views.py➡static_sites➡➡➡➡➡➡今回追加--3
|
108
|
+
|
109
|
+
```
|
110
|
+
|
111
|
+
from django.shortcuts import render
|
112
|
+
|
113
|
+
from django.http import HttpResponse
|
114
|
+
|
115
|
+
from django.shortcuts import render
|
116
|
+
|
117
|
+
# Create your views here.
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
63
|
-
index
|
123
|
+
def index(request):
|
124
|
+
|
64
|
-
|
125
|
+
return HttpResponse("Hello")
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
65
|
-
|
131
|
+
def show_index(request):
|
132
|
+
|
66
|
-
|
133
|
+
return render(request, 'index.html')
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
def show_no2(request):
|
140
|
+
|
141
|
+
return render(request, 'no2.html')
|
142
|
+
|
143
|
+
|
144
|
+
|
67
|
-
```
|
145
|
+
```
|
146
|
+
|
147
|
+
|
148
|
+
|
68
|
-
|
149
|
+
#-index.html➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡今回追加--4
|
150
|
+
|
151
|
+
```
|
152
|
+
|
69
|
-
<html>
|
153
|
+
<!DOCTYPE html>
|
154
|
+
|
155
|
+
<html lang="en">
|
70
156
|
|
71
157
|
<head>
|
72
158
|
|
159
|
+
<meta charset="UTF-8">
|
160
|
+
|
73
|
-
|
161
|
+
<title>Title</title>
|
74
162
|
|
75
163
|
</head>
|
76
164
|
|
77
165
|
<body>
|
78
166
|
|
79
|
-
|
167
|
+
index.html hogegegegegegegegegegegegegegegge
|
80
168
|
|
81
169
|
</body>
|
82
170
|
|
@@ -86,23 +174,25 @@
|
|
86
174
|
|
87
175
|
|
88
176
|
|
89
|
-
no2.html
|
177
|
+
#-no2.html➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡➡今回追加--5
|
90
|
-
|
91
|
-
|
92
|
-
|
178
|
+
|
93
|
-
```
|
179
|
+
```
|
94
|
-
|
180
|
+
|
95
|
-
<html>
|
181
|
+
<!DOCTYPE html>
|
182
|
+
|
183
|
+
<html lang="en">
|
96
184
|
|
97
185
|
<head>
|
98
186
|
|
187
|
+
<meta charset="UTF-8">
|
188
|
+
|
99
|
-
|
189
|
+
<title>Title</title>
|
100
190
|
|
101
191
|
</head>
|
102
192
|
|
103
193
|
<body>
|
104
194
|
|
105
|
-
|
195
|
+
no2.html hogeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
|
106
196
|
|
107
197
|
</body>
|
108
198
|
|
@@ -112,7 +202,25 @@
|
|
112
202
|
|
113
203
|
|
114
204
|
|
115
|
-
|
205
|
+
#
|
206
|
+
|
207
|
+
```
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
```
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
どこのフォルダに格納すればURLとして表示されるのでしょうか?通常djangoで処理を噛ませる場合はviewsやappやurlsなどに追加しますが、index.htmlやno2.htmlなど非常に簡単な構造のhtmlです。この場合djangoの連携をせずに単純にURLを叩いて表示させたいです。hoge.com/templetes/index.htmlなどURLで表示できないのでしょうか?
|
116
224
|
|
117
225
|
|
118
226
|
|
1
あ
test
CHANGED
File without changes
|
test
CHANGED
@@ -22,7 +22,7 @@
|
|
22
22
|
|
23
23
|
まず以下フォルダとディレクトリを用意します。
|
24
24
|
|
25
|
-
フォルダ名:
|
25
|
+
フォルダ名:templetes
|
26
26
|
|
27
27
|
folderに入っているhtmlファイル名:index.htmlとno2.html
|
28
28
|
|
@@ -40,7 +40,17 @@
|
|
40
40
|
|
41
41
|
-hoge.com
|
42
42
|
|
43
|
-
-manage.py
|
43
|
+
-manage.py
|
44
|
+
|
45
|
+
-project
|
46
|
+
|
47
|
+
-app
|
48
|
+
|
49
|
+
-templetes
|
50
|
+
|
51
|
+
-index.html
|
52
|
+
|
53
|
+
-no2.html
|
44
54
|
|
45
55
|
```
|
46
56
|
|
@@ -102,9 +112,7 @@
|
|
102
112
|
|
103
113
|
|
104
114
|
|
105
|
-
この場合、index.htmlとno2.htmlはdjangoのどこのフォルダに格納すれば表示されるのでしょうか?
|
106
|
-
|
107
|
-
django処理上噛ませる場合はviewsやappやurlsなどに追加しますが、index.htmlやno2.htmlなど非常に簡単な構造のhtmlの場合はdjangoの連携をせずに単純にURLを叩いて表示させたいです。hoge.com/templetes/index.htmlなど
|
115
|
+
この場合、index.htmlとno2.htmlはdjangoのどこのフォルダに格納すればURLとして表示されるのでしょうか?通常djangoで処理を噛ませる場合はviewsやappやurlsなどに追加しますが、index.htmlやno2.htmlなど非常に簡単な構造のhtmlです。この場合djangoの連携をせずに単純にURLを叩いて表示させたいです。hoge.com/templetes/index.htmlなどURLで表示できないのでしょうか?
|
108
116
|
|
109
117
|
|
110
118
|
|