機械学習初心者です。
ローカル上で作成したアプリをリモートサーバーへ転送しようとしたら、TypeError: strptime() argument 1 must be str, not float と転送先のURLに表示されました。 strであるべき引数がPosixPathになっているのが原因と分かっているのですが、うまく修正ができません。
エラーメッセージ
Template error: In template /URL/polls/index.html, error at line 1 argument 1 must be str, not PosixPath 1 : {% if latest_question_list %} 2 : <ul> 3 : {% for question in latest_question_list %} 4 : <li><a href="{% url 'polls:detail' question.id %}">{{ question.question_text }}</a></li> 5 : {% endfor %} 6 : </ul> 7 : {% else %} 8 : <p>No polls are available.</p> 9 : {% endif %} Exception Type: TypeError at /polls/ Exception Value: argument 1 must be str, not PosixPath
ソースコード
settings.py
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join (str(BASE_DIR / 'db.sqlite3')), }
マイグレーション、runserverでのエラー
TypeError: unsupported operand type(s) for /: 'str' and 'str'
試したこと
'NAME': os.path.join(str(BASE_DIR) , 'db.sqlite3')),
リモートサーバーで argument 1 must be str, not PosixPath とエラーあり。
マイグレーションでのエラーなし。
python manage.py runserver 0.0.0.0:8000
runserverでのエラーはないが、リモート (http://~.com:8000/polls) では、ページに到達できず。
使用ツール
Python3.6.9
Djando2.2.7
Windows10
使用ツールのローカルとリモートのバージョンを統一
ご教示頂けますと幸いです。どうぞよろしくお願いいたします

回答1件
あなたの回答
tips
プレビュー