質問編集履歴
5
文法の修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -164,22 +164,6 @@
|
|
164
164
|
|
165
165
|
fn(*args, **kwargs)
|
166
166
|
|
167
|
-
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 120, in inner_run
|
168
|
-
|
169
|
-
self.check_migrations()
|
170
|
-
|
171
|
-
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/core/management/base.py", line 453, in check_migrations
|
172
|
-
|
173
|
-
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
|
174
|
-
|
175
|
-
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/migrations/executor.py", line 18, in __init__
|
176
|
-
|
177
|
-
self.loader = MigrationLoader(self.connection)
|
178
|
-
|
179
|
-
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/migrations/loader.py", line 49, in __init__
|
180
|
-
|
181
|
-
self.build_graph()
|
182
|
-
|
183
167
|
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/migrations/loader.py", line 212, in build_graph
|
184
168
|
|
185
169
|
self.applied_migrations = recorder.applied_migrations()
|
@@ -192,27 +176,89 @@
|
|
192
176
|
|
193
177
|
return self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor())
|
194
178
|
|
195
|
-
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/backends/
|
179
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py", line 194, in get_new_connection
|
180
|
+
|
196
|
-
|
181
|
+
conn = Database.connect(**conn_params)
|
182
|
+
|
183
|
+
TypeError: argument 1 must be str, not PosixPa
|
184
|
+
|
185
|
+
```
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
マイグレーションを実行した際のエラー
|
190
|
+
|
191
|
+
```ここに言語を入力
|
192
|
+
|
193
|
+
Traceback (most recent call last):
|
194
|
+
|
195
|
+
File "/Users//.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/core/management/base.py", line 323, in run_from_argv
|
196
|
+
|
197
|
+
self.execute(*args, **cmd_options)
|
198
|
+
|
199
|
+
File "/Users//.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/core/management/base.py", line 364, in execute
|
200
|
+
|
201
|
+
output = self.handle(*args, **options)
|
202
|
+
|
203
|
+
File "/Users//.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/core/management/base.py", line 83, in wrapped
|
204
|
+
|
197
|
-
re
|
205
|
+
res = handle_func(*args, **kwargs)
|
198
|
-
|
206
|
+
|
199
|
-
File "/Users/
|
207
|
+
File "/Users//.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/backends/base/base.py", line 233, in _cursor
|
200
208
|
|
201
209
|
self.ensure_connection()
|
202
210
|
|
203
|
-
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/backends/base/base.py", line 217, in ensure_connection
|
204
|
-
|
205
|
-
self.connect()
|
206
|
-
|
207
|
-
File "/Users/
|
211
|
+
File "/Users//.pyenv/versions/3.6.5/lib/python3.6/site-
|
208
|
-
|
209
|
-
|
212
|
+
|
210
|
-
|
211
|
-
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py", line 194, in get_new_connection
|
212
|
-
|
213
|
-
conn = Database.connect(**conn_params)
|
214
|
-
|
215
|
-
TypeError: argument 1 must be str, not PosixPa
|
213
|
+
TypeError: argument 1 must be str, not PosixPath
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
During handling of the above exception, another exception occurred:
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
Traceback (most recent call last):
|
222
|
+
|
223
|
+
File "manage.py", line 22, in <module>
|
224
|
+
|
225
|
+
main()
|
226
|
+
|
227
|
+
File "manage.py", line 18, in main
|
228
|
+
|
229
|
+
execute_from_command_line(sys.argv)
|
230
|
+
|
231
|
+
File "/Users//.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
|
232
|
+
|
233
|
+
utility.execute()
|
234
|
+
|
235
|
+
File "/Users//.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
|
236
|
+
|
237
|
+
self.fetch_command(subcommand).run_from_argv(self.argv)
|
238
|
+
|
239
|
+
File "/Users//.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/core/management/base.py", line 336, in run_from_argv
|
240
|
+
|
241
|
+
connections.close_all()
|
242
|
+
|
243
|
+
File "/Users//.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/utils.py", line 224, in close_all
|
244
|
+
|
245
|
+
connection.close()
|
246
|
+
|
247
|
+
File "/Users//.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py", line 248, in close
|
248
|
+
|
249
|
+
if not self.is_in_memory_db():
|
250
|
+
|
251
|
+
File "/Users//.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py", line 367, in is_in_memory_db
|
252
|
+
|
253
|
+
return self.creation.is_in_memory_db(self.settings_dict['NAME'])
|
254
|
+
|
255
|
+
File "/Users//.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/backends/sqlite3/creation.py", line 12, in is_in_memory_db
|
256
|
+
|
257
|
+
return database_name == ':memory:' or 'mode=memory' in database_name
|
258
|
+
|
259
|
+
TypeError: argument of type 'PosixPath' is not iterable
|
260
|
+
|
261
|
+
|
216
262
|
|
217
263
|
```
|
218
264
|
|
4
文法の修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -130,6 +130,94 @@
|
|
130
130
|
|
131
131
|
|
132
132
|
|
133
|
+
###追記
|
134
|
+
|
135
|
+
Djangoのバージョンをローカルとリモートのバージョンを統一してからランサーバーしてでたエラー。
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
```ここに言語を入力
|
140
|
+
|
141
|
+
$python3 manage.py runserver 0.0.0.0:8000
|
142
|
+
|
143
|
+
Watching for file changes with StatReloader
|
144
|
+
|
145
|
+
Performing system checks...
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
System check identified no issues (0 silenced).
|
150
|
+
|
151
|
+
Exception in thread django-main-thread:
|
152
|
+
|
153
|
+
Traceback (most recent call last):
|
154
|
+
|
155
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/threading.py", line 916, in _bootstrap_inner
|
156
|
+
|
157
|
+
self.run()
|
158
|
+
|
159
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/threading.py", line 864, in run
|
160
|
+
|
161
|
+
self._target(*self._args, **self._kwargs)
|
162
|
+
|
163
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/utils/autoreload.py", line 54, in wrapper
|
164
|
+
|
165
|
+
fn(*args, **kwargs)
|
166
|
+
|
167
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 120, in inner_run
|
168
|
+
|
169
|
+
self.check_migrations()
|
170
|
+
|
171
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/core/management/base.py", line 453, in check_migrations
|
172
|
+
|
173
|
+
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
|
174
|
+
|
175
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/migrations/executor.py", line 18, in __init__
|
176
|
+
|
177
|
+
self.loader = MigrationLoader(self.connection)
|
178
|
+
|
179
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/migrations/loader.py", line 49, in __init__
|
180
|
+
|
181
|
+
self.build_graph()
|
182
|
+
|
183
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/migrations/loader.py", line 212, in build_graph
|
184
|
+
|
185
|
+
self.applied_migrations = recorder.applied_migrations()
|
186
|
+
|
187
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 73, in applied_migrations
|
188
|
+
|
189
|
+
if self.has_table():
|
190
|
+
|
191
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 56, in has_table
|
192
|
+
|
193
|
+
return self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor())
|
194
|
+
|
195
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/backends/base/base.py", line 256, in cursor
|
196
|
+
|
197
|
+
return self._cursor()
|
198
|
+
|
199
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/backends/base/base.py", line 233, in _cursor
|
200
|
+
|
201
|
+
self.ensure_connection()
|
202
|
+
|
203
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/backends/base/base.py", line 217, in ensure_connection
|
204
|
+
|
205
|
+
self.connect()
|
206
|
+
|
207
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/backends/base/base.py", line 195, in connect
|
208
|
+
|
209
|
+
self.connection = self.get_new_connection(conn_params)
|
210
|
+
|
211
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py", line 194, in get_new_connection
|
212
|
+
|
213
|
+
conn = Database.connect(**conn_params)
|
214
|
+
|
215
|
+
TypeError: argument 1 must be str, not PosixPa
|
216
|
+
|
217
|
+
```
|
218
|
+
|
219
|
+
|
220
|
+
|
133
221
|
###試したこと
|
134
222
|
|
135
223
|
|
3
文法の修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,8 +12,70 @@
|
|
12
12
|
|
13
13
|
|
14
14
|
|
15
|
+
Request Method: GET
|
16
|
+
|
17
|
+
Request URL: http://相手URL/アプリネーム/
|
18
|
+
|
19
|
+
Django Version: 2.2.7
|
20
|
+
|
21
|
+
Exception Type: TypeError
|
22
|
+
|
23
|
+
Exception Value:
|
24
|
+
|
25
|
+
argument 1 must be str, not PosixPath
|
26
|
+
|
27
|
+
Exception Location: /usr/local/lib/python3.6/dist-packages/django/db/backends/sqlite3/base.py in get_new_connection, line 194
|
28
|
+
|
29
|
+
Python Executable: /usr/local/bin/uwsgi
|
30
|
+
|
31
|
+
Python Version: 3.6.9
|
32
|
+
|
33
|
+
Python Path:
|
34
|
+
|
35
|
+
['.',
|
36
|
+
|
37
|
+
'',
|
38
|
+
|
39
|
+
'/usr/lib/python36.zip',
|
40
|
+
|
41
|
+
'/usr/lib/python3.6',
|
42
|
+
|
43
|
+
'/usr/lib/python3.6/lib-dynload',
|
44
|
+
|
45
|
+
'/usr/local/lib/python3.6/dist-packages',
|
46
|
+
|
47
|
+
'/usr/lib/python3/dist-packages']
|
48
|
+
|
49
|
+
Server time: Sun, 25 Apr 2021 07:02:50 +0000
|
50
|
+
|
15
51
|
Error during template rendering
|
16
52
|
|
53
|
+
In template /var/www/django/ファイル名/アプリネーム/templates/アプリネーム2/index.html, error at line 1
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
argument 1 must be str, not PosixPath
|
58
|
+
|
59
|
+
1 {% if latest_question_list %}
|
60
|
+
|
61
|
+
2 <ul>
|
62
|
+
|
63
|
+
3 {% for question in latest_question_list %}
|
64
|
+
|
65
|
+
4 <li><a href="{% url 'polls:detail' question.id %}">{{ question.question_text }}</a></li>
|
66
|
+
|
67
|
+
5 {% endfor %}
|
68
|
+
|
69
|
+
6 </ul>
|
70
|
+
|
71
|
+
7 {% else %}
|
72
|
+
|
73
|
+
8 <p>No polls are available.</p>
|
74
|
+
|
75
|
+
9 {% endif %}
|
76
|
+
|
77
|
+
10
|
78
|
+
|
17
79
|
```
|
18
80
|
|
19
81
|
|
2
文法の修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,6 +10,10 @@
|
|
10
10
|
|
11
11
|
argument 1 must be str, not PosixPath
|
12
12
|
|
13
|
+
|
14
|
+
|
15
|
+
Error during template rendering
|
16
|
+
|
13
17
|
```
|
14
18
|
|
15
19
|
|
1
文法の修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -14,11 +14,45 @@
|
|
14
14
|
|
15
15
|
|
16
16
|
|
17
|
+
下記の部分の文法でエラーがでてしまいました。
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
アプリネーム/index.html
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
```ここに言語を入力
|
26
|
+
|
27
|
+
{% if latest_question_list %} ←この行がエラーでています。
|
28
|
+
|
29
|
+
<ul>
|
30
|
+
|
31
|
+
{% for question in latest_question_list %}
|
32
|
+
|
33
|
+
<li><a href="{% url 'polls:detail' question.id %}">{{ question.question_text }}</a></li>
|
34
|
+
|
35
|
+
{% endfor %}
|
36
|
+
|
37
|
+
</ul>
|
38
|
+
|
39
|
+
{% else %}
|
40
|
+
|
41
|
+
<p>No polls are available.</p>
|
42
|
+
|
43
|
+
{% endif %}
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
```
|
48
|
+
|
49
|
+
|
50
|
+
|
17
51
|
自分のPCのローカルサーバではしっかりwebアプリケーションは動作しています。どのようにすればリモートサーバでも動作させることができるでしょうか?下記ようなURLに転送させたいです。
|
18
52
|
|
19
53
|
|
20
54
|
|
21
|
-
「http://
|
55
|
+
「http://相手URL/アプリネーム/」
|
22
56
|
|
23
57
|
|
24
58
|
|