#解決したいこと
ポート80指定でhttpプロトコルでのテストページ表示されるかの確認
#試したこと
ポート指定したときとしないときでサーバーが起動するかどうかの確認しました。
ポート指定なしですとサーバ起動確認できました。
ポート指定するとサーバー起動しませんでした。
sudoをつけて実行するとSyntaxエラーが帰ってきました。
[ec2-user@ip-xxx ~]$ python -V Python 3.6.5 [ec2-user@ip-xxx ~]$ python Python 3.6.5 (default, May 5 2018, 10:07:51) [GCC 7.3.1 20180303 (Red Hat 7.3.1-5)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import django >>> django.get_version() '2.0.5' >>> exit() [ec2-user@ip-xxx ~]$ mkdir django [ec2-user@ip-xxx ~]$ cd django [ec2-user@ip-xxx django]$ django-admin startproject mysite [ec2-user@ip-xxx django]$ cd mysite/ [ec2-user@ip-xxx mysite]$ python manage.py migrate Operations to perform: Apply all migrations: admin, auth, contenttypes, sessions Running migrations: Applying contenttypes.0001_initial... OK Applying auth.0001_initial... OK Applying admin.0001_initial... OK Applying admin.0002_logentry_remove_auto_add... OK Applying contenttypes.0002_remove_content_type_name... OK Applying auth.0002_alter_permission_name_max_length... OK Applying auth.0003_alter_user_email_max_length... OK Applying auth.0004_alter_user_username_opts... OK Applying auth.0005_alter_user_last_login_null... OK Applying auth.0006_require_contenttypes_0002... OK Applying auth.0007_alter_validators_add_error_messages... OK Applying auth.0008_alter_user_username_max_length... OK Applying auth.0009_alter_user_last_name_max_length... OK Applying sessions.0001_initial... OK [ec2-user@ip-xxx mysite]$ python manage.py createsuperuser Username (leave blank to use 'ec2-user'): Email address: Password: Password (again): Superuser created successfully. [ec2-user@ip-xxx mysite]$ [ec2-user@ip-xxx mysite]$ python manage.py runserver 0:80 Performing system checks... System check identified no issues (0 silenced). May 06, 2018 - 05:17:11 Django version 2.0.5, using settings 'mysite.settings' Starting development server at http://0:80/ Quit the server with CONTROL-C. Error: You don't have permission to access that port. [ec2-user@ip-xxx mysite]$ sudo python manage.py runserver 0:80 File "manage.py", line 14 ) from exc ^ SyntaxError: invalid syntax [ec2-user@ip-xxx mysite]$ python manage.py runserver 0 Performing system checks... System check identified no issues (0 silenced). May 06, 2018 - 05:21:58 Django version 2.0.5, using settings 'mysite.settings' Starting development server at http://127.0.0.1:0/ Quit the server with CONTROL-C. ^C[ec2-user@ip-xxx mysite]$ sudo python manage.py runserver 0:80 File "manage.py", line 14 ) from exc ^ SyntaxError: invalid syntax
よろしくお願いします。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/05/06 06:44
2018/05/06 06:46
2018/05/06 06:47
2018/05/06 06:48
2018/05/06 06:50
2018/05/06 06:57
2018/05/06 06:59