前提・実現したいこと
【実現したいこと】
cloud9でDjangoのwebページに接続したいです.
【前提】
・昨日からcloud9を使い始めた初心者です.
・clound9のproject settingから,pythonのバージョンは,python3に変更しました.
・cloud9で,下記コマンドを用いて,Djangoでプロジェクトを新規作成しました.
terminal
1*略*:~/environment $ django-admin startproject myapp
・settings.pyを以下の通り変更しました.
python
1ALLOWED_HOSTS = ['*']
・その後,下記コマンドをうち,サーバーを起動しました.
terminal
1*略*:~/environment/myapp $ python manage.py migrate 2Operations to perform: 3 Apply all migrations: admin, auth, contenttypes, sessions 4Running migrations: 5 Applying contenttypes.0001_initial... OK 6 Applying auth.0001_initial... OK 7 Applying admin.0001_initial... OK 8 Applying admin.0002_logentry_remove_auto_add... OK 9 Applying contenttypes.0002_remove_content_type_name... OK 10 Applying auth.0002_alter_permission_name_max_length... OK 11 Applying auth.0003_alter_user_email_max_length... OK 12 Applying auth.0004_alter_user_username_opts... OK 13 Applying auth.0005_alter_user_last_login_null... OK 14 Applying auth.0006_require_contenttypes_0002... OK 15 Applying auth.0007_alter_validators_add_error_messages... OK 16 Applying auth.0008_alter_user_username_max_length... OK 17 Applying auth.0009_alter_user_last_name_max_length... OK 18 Applying sessions.0001_initial... OK 19*略*:~/environment/myapp $ python manage.py runserver
・サーバーは起動しているように見えます.
terminal
1*略*/environment/myapp $ python manage.py runserver 2Performing system checks... 3 4System check identified no issues (0 silenced). 5February 05, 2019 - 14:42:39 6Django version 2.0.2, using settings 'myapp.settings' 7Starting development server at http://127.0.0.1:8000/ 8Quit the server with CONTROL-C.
発生している問題・エラーメッセージ
・http://127.0.0.1:8000/をpreview内で表示したのですが,
Unable to load http previewというページが表示され,Djangoのページが表示されません.
試したこと
・webで調べて,runserverを8080に変えてみたのですが,うまくいきませんでした.
terminal
1$ python manage.py runserver 8080
お手数をおかけしますが,お力をお借りできると助かります.

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/02/06 10:59
2019/02/07 02:45
2019/02/07 14:38