質問編集履歴

2

2019/09/05 02:23

投稿

InKAICla8r3VszV
InKAICla8r3VszV

スコア4

test CHANGED
File without changes
test CHANGED
@@ -24,7 +24,9 @@
24
24
 
25
25
 
26
26
 
27
- 1、アプリケーションの登録
27
+ 1、アプリケーションの登録
28
+
29
+ hello を追加しました
28
30
 
29
31
  setting.py
30
32
 

1

手順を追加しました

2019/09/05 02:23

投稿

InKAICla8r3VszV
InKAICla8r3VszV

スコア4

test CHANGED
File without changes
test CHANGED
@@ -20,17 +20,111 @@
20
20
 
21
21
  ### 該当のソースコード
22
22
 
23
+ 1〜5の手順でしています
24
+
25
+
26
+
27
+ 1、アプリケーションの登録
28
+
29
+ setting.py
30
+
31
+
32
+
33
+ 〜省略
34
+
35
+ INSTALLED_APPS = [
36
+
37
+ 'django.contrib.admin',
38
+
39
+ 'django.contrib.auth',
40
+
41
+ 'django.contrib.contenttypes',
42
+
43
+ 'django.contrib.sessions',
44
+
45
+ 'django.contrib.messages',
46
+
47
+ 'django.contrib.staticfiles',
48
+
49
+ 'hello'
50
+
51
+ ]
52
+
53
+ 〜省略
54
+
55
+
56
+
57
+ 2、index.htmlを作成する
58
+
59
+ index.html
60
+
61
+
62
+
63
+ <!doctype html>
64
+
65
+ <html lang="ja">
66
+
67
+ <head>
68
+
69
+ <meta charset="utf-8">
70
+
71
+ <title>hello</title>
72
+
73
+ </head>
74
+
75
+ <body>
76
+
77
+ <h1>hello/index</h1>
78
+
79
+ <p>This is sample page.</p>
80
+
81
+ </body>
82
+
83
+ </html>
84
+
85
+
86
+
87
+ 3、urlpatternsの修正
88
+
89
+ url.py
90
+
91
+
92
+
93
+ from django.urls import path
94
+
95
+ from . import views
96
+
97
+
98
+
99
+ urlpatterns = [
100
+
101
+ path('', views.index, name='index'),
102
+
103
+ ]
104
+
105
+
106
+
107
+ 4、indexの修正
108
+
109
+ views.py
110
+
23
111
 
24
112
 
25
113
  from django.shortcuts import render
26
114
 
27
- from djamgo.http import HttpResponse
115
+ from djamgo.http import HttpResponse #ここでエラー
28
116
 
29
117
 
30
118
 
31
119
  def index(request):
32
120
 
33
121
  return render(request, 'hello/index.html')
122
+
123
+
124
+
125
+ 5、Webブラウザに表示
126
+
127
+    →されなかった
34
128
 
35
129
 
36
130