質問編集履歴
5
いただいた回答をもとに追追記しました。あと今更ながら初心者マークつけました(あるの知らなかったので)。。
test
CHANGED
File without changes
|
test
CHANGED
@@ -178,6 +178,106 @@
|
|
178
178
|
|
179
179
|
|
180
180
|
|
181
|
+
追追記
|
182
|
+
|
183
|
+
sukekeke0さんからいただいた
|
184
|
+
|
185
|
+
> pathの第1引数のスペースを消したら直りませんか?
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
といただいたので、直してみました。
|
190
|
+
|
191
|
+
もう一度python manage.py runserverを実行したところ
|
192
|
+
|
193
|
+
```
|
194
|
+
|
195
|
+
PS C:\Users\user\Desktop\django_app> python manage.py runserver
|
196
|
+
|
197
|
+
Watching for file changes with StatReloader
|
198
|
+
|
199
|
+
Performing system checks...
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
Exception in thread django-main-thread:
|
204
|
+
|
205
|
+
Traceback (most recent call last):
|
206
|
+
|
207
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\urls\resolvers.py", line 591, in url_patterns
|
208
|
+
|
209
|
+
iter(patterns)
|
210
|
+
|
211
|
+
TypeError: 'module' object is not iterable
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
The above exception was the direct cause of the following exception:
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
Traceback (most recent call last):
|
220
|
+
|
221
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\threading.py", line 950, in _bootstrap_inner
|
222
|
+
|
223
|
+
self.run()
|
224
|
+
|
225
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\threading.py", line 888, in run
|
226
|
+
|
227
|
+
self._target(*self._args, **self._kwargs)
|
228
|
+
|
229
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper
|
230
|
+
|
231
|
+
fn(*args, **kwargs)
|
232
|
+
|
233
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\commands\runserver.py", line 118, in inner_run
|
234
|
+
|
235
|
+
self.check(display_num_errors=True)
|
236
|
+
|
237
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\base.py", line 392, in check
|
238
|
+
|
239
|
+
all_issues = checks.run_checks(
|
240
|
+
|
241
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\checks\registry.py", line 70, in run_checks
|
242
|
+
|
243
|
+
new_errors = check(app_configs=app_configs, databases=databases)
|
244
|
+
|
245
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\checks\urls.py", line 13, in check_url_config
|
246
|
+
|
247
|
+
return check_resolver(resolver)
|
248
|
+
|
249
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\checks\urls.py", line 23, in check_resolver
|
250
|
+
|
251
|
+
return check_method()
|
252
|
+
|
253
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\urls\resolvers.py", line 409, in check
|
254
|
+
|
255
|
+
messages.extend(check_resolver(pattern))
|
256
|
+
|
257
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\checks\urls.py", line 23, in check_resolver
|
258
|
+
|
259
|
+
return check_method()
|
260
|
+
|
261
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\urls\resolvvers.py", line 408, in check
|
262
|
+
|
263
|
+
for pattern in self.url_patterns:
|
264
|
+
|
265
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\functtional.py", line 48, in __get__
|
266
|
+
|
267
|
+
res = instance.__dict__[self.name] = self.func(instance)
|
268
|
+
|
269
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\urls\resolvvers.py", line 598, in url_patterns
|
270
|
+
|
271
|
+
raise ImproperlyConfigured(msg.format(name=self.urlconf_name)) from e
|
272
|
+
|
273
|
+
django.core.exceptions.ImproperlyConfigured: The included URLconf '<module 'hello.urls' from 'C:\\Users\user\Desktop\django_app\hello\urls.py'>' does not appear to have any patterns in it . If you see valid patterns in the file then the issue is probably caused by a circular import.
|
274
|
+
|
275
|
+
```
|
276
|
+
|
277
|
+
と、、今度はFile "C:\Users\user\Desktop\django_app\hello\urls.py"から始まるエラーがないのでエラーがなんなのかわかりません。(ちなみにいまだにlocalhostではアクセスできませんでした。)
|
278
|
+
|
279
|
+
|
280
|
+
|
181
281
|
### 補足情報(FW/ツールのバージョンなど)
|
182
282
|
|
183
283
|
|
4
コマンドプロンプトでnetstat -anp tcp|findstr -i 8000を実行した結果を載せました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -189,3 +189,13 @@
|
|
189
189
|
・Version python3.9.0 django3.1.2
|
190
190
|
|
191
191
|
・実行したコマンド python manage.py runserver
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
追記
|
196
|
+
|
197
|
+
コマンドプロンプトでnetstat -anp tcp|findstr -i 8000を実行した結果
|
198
|
+
|
199
|
+
![イメージ説明](3bd2ec4cb6bdbb9f003446f709b1c7ec.jpeg)
|
200
|
+
|
201
|
+
なにも出てきませんでした。
|
3
現象発生時のブラウザのスクショを追記しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -172,7 +172,9 @@
|
|
172
172
|
|
173
173
|
```
|
174
174
|
|
175
|
+
現象発生時のブラウザのスクショはこんな感じです。
|
175
176
|
|
177
|
+
![![イメージ説明](4225a59d17b6d0ce54749dc8c725de6a.jpeg)]![![イメージ説明](119d568b63c95df466ae57ec3161896f.jpeg)]
|
176
178
|
|
177
179
|
|
178
180
|
|
2
>python manage.py runserverを試した結果を追記しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -28,6 +28,8 @@
|
|
28
28
|
|
29
29
|
|
30
30
|
|
31
|
+
|
32
|
+
|
31
33
|
### 試したこと
|
32
34
|
|
33
35
|
|
@@ -35,6 +37,142 @@
|
|
35
37
|
作ってたアプリケーションの問題かと思い、アプリは丸ごと一回消して、最初からやり直してみました。ですが、初めに作ったのと違って、いわゆるロケットのサンプルページはでなくなってしまいました。
|
36
38
|
|
37
39
|
ネットで「localhost 接続拒否」で調べてみましたが、同条件の人が見つけられなかったため、こちらに質問しているといった状況です。
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
追記
|
44
|
+
|
45
|
+
>python manage.py runserverを試した結果は以下の通りです。
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
```
|
50
|
+
|
51
|
+
PS C:\Users\user\Desktop\django_app> python manage.py runserver
|
52
|
+
|
53
|
+
Watching for file changes with StatReloader
|
54
|
+
|
55
|
+
Performing system checks...
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
Exception in thread django-main-thread:
|
60
|
+
|
61
|
+
Traceback (most recent call last):
|
62
|
+
|
63
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\threading.py", line 950, in _bootstrap_inner
|
64
|
+
|
65
|
+
self.run()
|
66
|
+
|
67
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\threading.py", line 888, in run
|
68
|
+
|
69
|
+
self._target(*self._args, **self._kwargs)
|
70
|
+
|
71
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper
|
72
|
+
|
73
|
+
fn(*args, **kwargs)
|
74
|
+
|
75
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\commands\runserver.py", line 118, in inner_run
|
76
|
+
|
77
|
+
self.check(display_num_errors=True)
|
78
|
+
|
79
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\base.py", line 392, in check
|
80
|
+
|
81
|
+
all_issues = checks.run_checks(
|
82
|
+
|
83
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\checks\registry.py", line 70, in run_checks
|
84
|
+
|
85
|
+
new_errors = check(app_configs=app_configs, databases=databases)
|
86
|
+
|
87
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\checks\urls.py", line 13, in check_url_config
|
88
|
+
|
89
|
+
return check_resolver(resolver)
|
90
|
+
|
91
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\checks\urls.py", line 23, in check_resolver
|
92
|
+
|
93
|
+
return check_method()
|
94
|
+
|
95
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\urls\resolvers.py", line 408, in check
|
96
|
+
|
97
|
+
for pattern in self.url_patterns:
|
98
|
+
|
99
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\functional.py", line 48, in __get__
|
100
|
+
|
101
|
+
res = instance.__dict__[self.name] = self.func(instance)
|
102
|
+
|
103
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\urls\resolvers.py", line 589, in url_patterns
|
104
|
+
|
105
|
+
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
|
106
|
+
|
107
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\functional.py", line 48, in __get__
|
108
|
+
|
109
|
+
res = instance.__dict__[self.name] = self.func(instance)
|
110
|
+
|
111
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\urls\resolvers.py", line 582, in urlconf_module
|
112
|
+
|
113
|
+
return import_module(self.urlconf_name)
|
114
|
+
|
115
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\importlib\__init__.py", line 127, in import_module
|
116
|
+
|
117
|
+
return _bootstrap._gcd_import(name[level:], package, level)
|
118
|
+
|
119
|
+
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
|
120
|
+
|
121
|
+
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
|
122
|
+
|
123
|
+
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
|
124
|
+
|
125
|
+
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
|
126
|
+
|
127
|
+
File "<frozen importlib._bootstrap_external>", line 790, in exec_module
|
128
|
+
|
129
|
+
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
|
130
|
+
|
131
|
+
File "C:\Users\user\Desktop\django_app\django_app\urls.py", line 21, in <module>
|
132
|
+
|
133
|
+
path('hello/',include('hello.urls')),
|
134
|
+
|
135
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\urls\conf.py", line 34, in include
|
136
|
+
|
137
|
+
urlconf_module = import_module(urlconf_module)
|
138
|
+
|
139
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\importlib\__init__.py", line 127, in import_module
|
140
|
+
|
141
|
+
return _bootstrap._gcd_import(name[level:], package, level)
|
142
|
+
|
143
|
+
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
|
144
|
+
|
145
|
+
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
|
146
|
+
|
147
|
+
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
|
148
|
+
|
149
|
+
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
|
150
|
+
|
151
|
+
File "<frozen importlib._bootstrap_external>", line 790, in exec_module
|
152
|
+
|
153
|
+
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
|
154
|
+
|
155
|
+
File "C:\Users\user\Desktop\django_app\hello\urls.py", line 5, in <module>
|
156
|
+
|
157
|
+
path(' ', views.index, name='index'),
|
158
|
+
|
159
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\urls\conf.py", line 70, in _path
|
160
|
+
|
161
|
+
pattern = Pattern(route, name=name, is_endpoint=True)
|
162
|
+
|
163
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\urls\resolvers.py", line 255, in __init__
|
164
|
+
|
165
|
+
self.converters = _route_to_regex(str(route), is_endpoint)[1]
|
166
|
+
|
167
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\urls\resolvers.py", line 212, in _route_to_regex
|
168
|
+
|
169
|
+
raise ImproperlyConfigured("URL route '%s' cannot contain whitespace." % route)
|
170
|
+
|
171
|
+
django.core.exceptions.ImproperlyConfigured: URL route ' ' cannot contain whitespace.
|
172
|
+
|
173
|
+
```
|
174
|
+
|
175
|
+
|
38
176
|
|
39
177
|
|
40
178
|
|
1
補足情報をつけ足しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -42,4 +42,10 @@
|
|
42
42
|
|
43
43
|
|
44
44
|
|
45
|
+
・実行したOS Windows10
|
46
|
+
|
47
|
+
・使用したブラウザ Microsoft Edge →調べたらEdgeだとエラーが出る場合があるのでChromeも試してみましたがダメでした
|
48
|
+
|
49
|
+
・Version python3.9.0 django3.1.2
|
50
|
+
|
45
|
-
|
51
|
+
・実行したコマンド python manage.py runserver
|