質問編集履歴
5
文法の修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -81,33 +81,56 @@
|
|
81
81
|
self._target(*self._args, **self._kwargs)
|
82
82
|
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/utils/autoreload.py", line 54, in wrapper
|
83
83
|
fn(*args, **kwargs)
|
84
|
-
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 120, in inner_run
|
85
|
-
self.check_migrations()
|
86
|
-
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/core/management/base.py", line 453, in check_migrations
|
87
|
-
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
|
88
|
-
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/migrations/executor.py", line 18, in __init__
|
89
|
-
self.loader = MigrationLoader(self.connection)
|
90
|
-
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/migrations/loader.py", line 49, in __init__
|
91
|
-
self.build_graph()
|
92
84
|
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/migrations/loader.py", line 212, in build_graph
|
93
85
|
self.applied_migrations = recorder.applied_migrations()
|
94
86
|
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 73, in applied_migrations
|
95
87
|
if self.has_table():
|
96
88
|
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 56, in has_table
|
97
89
|
return self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor())
|
98
|
-
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/backends/base/base.py", line 256, in cursor
|
99
|
-
return self._cursor()
|
100
|
-
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/backends/base/base.py", line 233, in _cursor
|
101
|
-
self.ensure_connection()
|
102
|
-
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/backends/base/base.py", line 217, in ensure_connection
|
103
|
-
self.connect()
|
104
|
-
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/backends/base/base.py", line 195, in connect
|
105
|
-
self.connection = self.get_new_connection(conn_params)
|
106
90
|
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
|
107
91
|
conn = Database.connect(**conn_params)
|
108
92
|
TypeError: argument 1 must be str, not PosixPa
|
109
93
|
```
|
110
94
|
|
95
|
+
マイグレーションを実行した際のエラー
|
96
|
+
```ここに言語を入力
|
97
|
+
Traceback (most recent call last):
|
98
|
+
File "/Users//.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/core/management/base.py", line 323, in run_from_argv
|
99
|
+
self.execute(*args, **cmd_options)
|
100
|
+
File "/Users//.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/core/management/base.py", line 364, in execute
|
101
|
+
output = self.handle(*args, **options)
|
102
|
+
File "/Users//.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/core/management/base.py", line 83, in wrapped
|
103
|
+
res = handle_func(*args, **kwargs)
|
104
|
+
File "/Users//.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/backends/base/base.py", line 233, in _cursor
|
105
|
+
self.ensure_connection()
|
106
|
+
File "/Users//.pyenv/versions/3.6.5/lib/python3.6/site-
|
107
|
+
TypeError: argument 1 must be str, not PosixPath
|
108
|
+
|
109
|
+
During handling of the above exception, another exception occurred:
|
110
|
+
|
111
|
+
Traceback (most recent call last):
|
112
|
+
File "manage.py", line 22, in <module>
|
113
|
+
main()
|
114
|
+
File "manage.py", line 18, in main
|
115
|
+
execute_from_command_line(sys.argv)
|
116
|
+
File "/Users//.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
|
117
|
+
utility.execute()
|
118
|
+
File "/Users//.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
|
119
|
+
self.fetch_command(subcommand).run_from_argv(self.argv)
|
120
|
+
File "/Users//.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/core/management/base.py", line 336, in run_from_argv
|
121
|
+
connections.close_all()
|
122
|
+
File "/Users//.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/utils.py", line 224, in close_all
|
123
|
+
connection.close()
|
124
|
+
File "/Users//.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py", line 248, in close
|
125
|
+
if not self.is_in_memory_db():
|
126
|
+
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
|
127
|
+
return self.creation.is_in_memory_db(self.settings_dict['NAME'])
|
128
|
+
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
|
129
|
+
return database_name == ':memory:' or 'mode=memory' in database_name
|
130
|
+
TypeError: argument of type 'PosixPath' is not iterable
|
131
|
+
|
132
|
+
```
|
133
|
+
|
111
134
|
###試したこと
|
112
135
|
|
113
136
|
settings.pyの
|
4
文法の修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -64,6 +64,50 @@
|
|
64
64
|
|
65
65
|
いろいろ調べてみてDjangoのsettings.pyがいけないのかなと?と考えていますがこのエラーは治りません。
|
66
66
|
|
67
|
+
###追記
|
68
|
+
Djangoのバージョンをローカルとリモートのバージョンを統一してからランサーバーしてでたエラー。
|
69
|
+
|
70
|
+
```ここに言語を入力
|
71
|
+
$python3 manage.py runserver 0.0.0.0:8000
|
72
|
+
Watching for file changes with StatReloader
|
73
|
+
Performing system checks...
|
74
|
+
|
75
|
+
System check identified no issues (0 silenced).
|
76
|
+
Exception in thread django-main-thread:
|
77
|
+
Traceback (most recent call last):
|
78
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/threading.py", line 916, in _bootstrap_inner
|
79
|
+
self.run()
|
80
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/threading.py", line 864, in run
|
81
|
+
self._target(*self._args, **self._kwargs)
|
82
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/utils/autoreload.py", line 54, in wrapper
|
83
|
+
fn(*args, **kwargs)
|
84
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 120, in inner_run
|
85
|
+
self.check_migrations()
|
86
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/core/management/base.py", line 453, in check_migrations
|
87
|
+
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
|
88
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/migrations/executor.py", line 18, in __init__
|
89
|
+
self.loader = MigrationLoader(self.connection)
|
90
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/migrations/loader.py", line 49, in __init__
|
91
|
+
self.build_graph()
|
92
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/migrations/loader.py", line 212, in build_graph
|
93
|
+
self.applied_migrations = recorder.applied_migrations()
|
94
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 73, in applied_migrations
|
95
|
+
if self.has_table():
|
96
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 56, in has_table
|
97
|
+
return self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor())
|
98
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/backends/base/base.py", line 256, in cursor
|
99
|
+
return self._cursor()
|
100
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/backends/base/base.py", line 233, in _cursor
|
101
|
+
self.ensure_connection()
|
102
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/backends/base/base.py", line 217, in ensure_connection
|
103
|
+
self.connect()
|
104
|
+
File "/Users/myfile/.pyenv/versions/3.6.5/lib/python3.6/site-packages/django/db/backends/base/base.py", line 195, in connect
|
105
|
+
self.connection = self.get_new_connection(conn_params)
|
106
|
+
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
|
107
|
+
conn = Database.connect(**conn_params)
|
108
|
+
TypeError: argument 1 must be str, not PosixPa
|
109
|
+
```
|
110
|
+
|
67
111
|
###試したこと
|
68
112
|
|
69
113
|
settings.pyの
|
3
文法の修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -5,7 +5,38 @@
|
|
5
5
|
TypeError at /アプリネーム/
|
6
6
|
argument 1 must be str, not PosixPath
|
7
7
|
|
8
|
+
Request Method: GET
|
9
|
+
Request URL: http://相手URL/アプリネーム/
|
10
|
+
Django Version: 2.2.7
|
11
|
+
Exception Type: TypeError
|
12
|
+
Exception Value:
|
13
|
+
argument 1 must be str, not PosixPath
|
14
|
+
Exception Location: /usr/local/lib/python3.6/dist-packages/django/db/backends/sqlite3/base.py in get_new_connection, line 194
|
15
|
+
Python Executable: /usr/local/bin/uwsgi
|
16
|
+
Python Version: 3.6.9
|
17
|
+
Python Path:
|
18
|
+
['.',
|
19
|
+
'',
|
20
|
+
'/usr/lib/python36.zip',
|
21
|
+
'/usr/lib/python3.6',
|
22
|
+
'/usr/lib/python3.6/lib-dynload',
|
23
|
+
'/usr/local/lib/python3.6/dist-packages',
|
24
|
+
'/usr/lib/python3/dist-packages']
|
25
|
+
Server time: Sun, 25 Apr 2021 07:02:50 +0000
|
8
26
|
Error during template rendering
|
27
|
+
In template /var/www/django/ファイル名/アプリネーム/templates/アプリネーム2/index.html, error at line 1
|
28
|
+
|
29
|
+
argument 1 must be str, not PosixPath
|
30
|
+
1 {% if latest_question_list %}
|
31
|
+
2 <ul>
|
32
|
+
3 {% for question in latest_question_list %}
|
33
|
+
4 <li><a href="{% url 'polls:detail' question.id %}">{{ question.question_text }}</a></li>
|
34
|
+
5 {% endfor %}
|
35
|
+
6 </ul>
|
36
|
+
7 {% else %}
|
37
|
+
8 <p>No polls are available.</p>
|
38
|
+
9 {% endif %}
|
39
|
+
10
|
9
40
|
```
|
10
41
|
|
11
42
|
下記の部分の文法でエラーがでてしまいました。
|
2
文法の修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -4,6 +4,8 @@
|
|
4
4
|
```
|
5
5
|
TypeError at /アプリネーム/
|
6
6
|
argument 1 must be str, not PosixPath
|
7
|
+
|
8
|
+
Error during template rendering
|
7
9
|
```
|
8
10
|
|
9
11
|
下記の部分の文法でエラーがでてしまいました。
|
1
文法の修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -6,9 +6,26 @@
|
|
6
6
|
argument 1 must be str, not PosixPath
|
7
7
|
```
|
8
8
|
|
9
|
+
下記の部分の文法でエラーがでてしまいました。
|
10
|
+
|
11
|
+
アプリネーム/index.html
|
12
|
+
|
13
|
+
```ここに言語を入力
|
14
|
+
{% if latest_question_list %} ←この行がエラーでています。
|
15
|
+
<ul>
|
16
|
+
{% for question in latest_question_list %}
|
17
|
+
<li><a href="{% url 'polls:detail' question.id %}">{{ question.question_text }}</a></li>
|
18
|
+
{% endfor %}
|
19
|
+
</ul>
|
20
|
+
{% else %}
|
21
|
+
<p>No polls are available.</p>
|
22
|
+
{% endif %}
|
23
|
+
|
24
|
+
```
|
25
|
+
|
9
26
|
自分のPCのローカルサーバではしっかりwebアプリケーションは動作しています。どのようにすればリモートサーバでも動作させることができるでしょうか?下記ようなURLに転送させたいです。
|
10
27
|
|
11
|
-
「http://
|
28
|
+
「http://相手URL/アプリネーム/」
|
12
29
|
|
13
30
|
このURLにSafariとChromeを使ってアクセスしましたがどちらとも同じエラーでした。
|
14
31
|
|