前提
ローカルで作ったDjangoのプロジェクトをVPSサーバーに保存したあとVPSサーバーからDjangoのプロジェクトを起動する、
というところで引っかかって困っています。
ターミナルで以下を実施しています。
- Djangoとgunicornのインストール
- settings.pyファイルの設定
- Migration等のコマンドの実行
以上を行って、レンタルしたVPSサーバーのアドレスを使ってブラウザにURLを打ち込んだところ、
ブラウザに以下のエラーメッセージが発生しました。
ERROR
The requested URL could not be retrieved
The following error was encountered while trying to retrieve the URL: http://"VPSサーバーのアドレス"/"プロジェクトのpath"/
Connection to "VPSサーバーのアドレス" failed.
The system returned: (110) Connection timed out
The remote host or network may be down. Please try the request again.
Your cache administrator is root.
※Udemyの講座「【徹底的に解説!】Djangoの基礎をマスターして、3つのアプリを作ろう!」で学習しています。
ちなみに、講座がベースとしているウェブはこちらのようです。
https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-18-04
実現したいこと
講座では普通にDjangoのプロジェクトがローカルのPCで起動していたように起動できていました。
同じようにVPSサーバーからの起動ができるようにしたいです。
よろしくお願いします。
発生している問題・エラーメッセージ
ERROR The requested URL could not be retrieved The following error was encountered while trying to retrieve the URL: http://"VPSサーバーのアドレス"/"プロジェクトのpath"/ Connection to "VPSサーバーのアドレス" failed. The system returned: (110) Connection timed out The remote host or network may be down. Please try the request again. Your cache administrator is root.
該当のソースコード
Ubuntu
1 21. Djangoとgunicornのインストール 3 pip install django gunicorn psycopg2-binary 42. settings.pyファイルの設定 5 vim ~/todoproject/todoproject/settings.py 63. Migration等のコマンドの実行 7 manage.py makemigrations 8 manege.py migrate 9 manage.py collectstatic 10 manage.py createsuperuser 114. gunicornが起動するか確かめてみる 12 sudo ufw allow 8000 13 gunicorn --bind 0.0.0.0:8000 "プロジェクト名".wsgi
試したこと
ここに問題に対して試したことを記載してください。
補足情報(FW/ツールのバージョンなど)
VPS:さくらのVPS
Ubuntu:Ubuntu 20.04.4 LTS \n \l
IDE:PyCharm 2022.2.1 (Community Edition)

回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。