質問編集履歴
3
追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
]
|
18
18
|
|
19
|
-
|
19
|
+
|
20
20
|
|
21
21
|
```
|
22
22
|
|
@@ -36,7 +36,7 @@
|
|
36
36
|
|
37
37
|
return HttpResponse('hello world')
|
38
38
|
|
39
|
-
|
39
|
+
|
40
40
|
|
41
41
|
```
|
42
42
|
|
@@ -106,6 +106,10 @@
|
|
106
106
|
|
107
107
|
|
108
108
|
|
109
|
-
|
109
|
+
|
110
110
|
|
111
111
|
```
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
Python 3.9.3で最新だからでしょうか
|
2
貼り付けまちがったのでもう一回更新しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
【urls.py】
|
2
2
|
|
3
|
+
```
|
4
|
+
|
3
|
-
|
5
|
+
from django.contrib import admin
|
4
6
|
|
5
7
|
from django.urls import path
|
6
8
|
|
@@ -24,7 +26,9 @@
|
|
24
26
|
|
25
27
|
【views.py】
|
26
28
|
|
29
|
+
```
|
30
|
+
|
27
|
-
|
31
|
+
from django.http import HttpResponse
|
28
32
|
|
29
33
|
|
30
34
|
|
@@ -54,7 +58,9 @@
|
|
54
58
|
|
55
59
|
|
56
60
|
|
61
|
+
```
|
62
|
+
|
57
|
-
|
63
|
+
#!/usr/bin/env python
|
58
64
|
|
59
65
|
"""Django's command-line utility for administrative tasks."""
|
60
66
|
|
@@ -98,6 +104,8 @@
|
|
98
104
|
|
99
105
|
main()
|
100
106
|
|
107
|
+
|
108
|
+
|
101
109
|
コード
|
102
110
|
|
103
111
|
```
|
1
すみません追記しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
【urls.py】
|
2
2
|
|
3
|
-
from django.contrib import admin
|
3
|
+
```from django.contrib import admin
|
4
4
|
|
5
5
|
from django.urls import path
|
6
6
|
|
@@ -10,9 +10,13 @@
|
|
10
10
|
|
11
11
|
path('admin/', admin.site.urls),
|
12
12
|
|
13
|
-
path('helloworldurl/',
|
13
|
+
path('helloworldurl/', func),
|
14
14
|
|
15
15
|
]
|
16
|
+
|
17
|
+
コード
|
18
|
+
|
19
|
+
```
|
16
20
|
|
17
21
|
|
18
22
|
|
@@ -20,13 +24,17 @@
|
|
20
24
|
|
21
25
|
【views.py】
|
22
26
|
|
23
|
-
from django.http import HttpResponse
|
27
|
+
```from django.http import HttpResponse
|
24
28
|
|
25
29
|
|
26
30
|
|
27
|
-
def
|
31
|
+
def func(request):
|
28
32
|
|
29
33
|
return HttpResponse('hello world')
|
34
|
+
|
35
|
+
コード
|
36
|
+
|
37
|
+
```
|
30
38
|
|
31
39
|
|
32
40
|
|
@@ -43,3 +51,53 @@
|
|
43
51
|
|
44
52
|
|
45
53
|
helloworldfuncは間違ってないと思うのですが、何が考えられますでしょうか
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
```#!/usr/bin/env python
|
58
|
+
|
59
|
+
"""Django's command-line utility for administrative tasks."""
|
60
|
+
|
61
|
+
import os
|
62
|
+
|
63
|
+
import sys
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
def main():
|
70
|
+
|
71
|
+
"""Run administrative tasks."""
|
72
|
+
|
73
|
+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'helloworldproject.settings')
|
74
|
+
|
75
|
+
try:
|
76
|
+
|
77
|
+
from django.core.management import execute_from_command_line
|
78
|
+
|
79
|
+
except ImportError as exc:
|
80
|
+
|
81
|
+
raise ImportError(
|
82
|
+
|
83
|
+
"Couldn't import Django. Are you sure it's installed and "
|
84
|
+
|
85
|
+
"available on your PYTHONPATH environment variable? Did you "
|
86
|
+
|
87
|
+
"forget to activate a virtual environment?"
|
88
|
+
|
89
|
+
) from exc
|
90
|
+
|
91
|
+
execute_from_command_line(sys.argv)
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
if __name__ == '__main__':
|
98
|
+
|
99
|
+
main()
|
100
|
+
|
101
|
+
コード
|
102
|
+
|
103
|
+
```
|