I tried exactly the same as the README.md says and deployed my application on a ubuntu AWS EC2 instance. When I ran the script, it seems that gunicorn has started my application,
ubuntu@ip-172-31-44-194:~/team6412-S18/phase1$ sudo ./deploydjango.sh phase1
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-pip is already the newest version (8.1.1-2ubuntu0.4).
0 upgraded, 0 newly installed, 0 to remove and 57 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
nginx is already the newest version (1.10.3-0ubuntu0.16.04.2).
0 upgraded, 0 newly installed, 0 to remove and 57 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
wget is already the newest version (1.17.1-1ubuntu1.3).
0 upgraded, 0 newly installed, 0 to remove and 57 not upgraded.
The directory '/home/ubuntu/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/ubuntu/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: gunicorn in /usr/local/lib/python3.5/dist-packages
--2018-03-19 22:59:29-- https://raw.githubusercontent.com/yask123/nginx-conf/master/nginx.conf
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.200.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.200.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1570 (1.5K) [text/plain]
Saving to: ‘nginx.conf’
nginx.conf 100%[==========================================================>] 1.53K --.-KB/s in 0s
2018-03-19 22:59:29 (362 MB/s) - ‘nginx.conf’ saved [1570/1570]
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
You have requested to collect static files at the destination
location as specified in your settings.
This will overwrite existing files!
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel: yes
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.5/dist-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.5/dist-packages/django/core/management/__init__.py", line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.5/dist-packages/django/core/management/base.py", line 288, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.5/dist-packages/django/core/management/base.py", line 335, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.5/dist-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 189, in handle
collected = self.collect()
File "/usr/local/lib/python3.5/dist-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 114, in collect
handler(path, prefixed_path, storage)
File "/usr/local/lib/python3.5/dist-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 344, in copy_file
if not self.delete_file(path, prefixed_path, source_storage):
File "/usr/local/lib/python3.5/dist-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 250, in delete_file
if self.storage.exists(prefixed_path):
File "/usr/local/lib/python3.5/dist-packages/django/core/files/storage.py", line 308, in exists
return os.path.exists(self.path(name))
File "/usr/local/lib/python3.5/dist-packages/django/contrib/staticfiles/storage.py", line 43, in path
raise ImproperlyConfigured("You're using the staticfiles app "
django.core.exceptions.ImproperlyConfigured: You're using the staticfiles app without having set the STATIC_ROOT setting to a filesystem path.
[2018-03-19 22:59:31 +0000] [9524] [INFO] Starting gunicorn 19.7.1
[2018-03-19 22:59:31 +0000] [9524] [INFO] Listening at: http://127.0.0.1:8000 (9524)
[2018-03-19 22:59:31 +0000] [9524] [INFO] Using worker: sync
[2018-03-19 22:59:31 +0000] [9527] [INFO] Booting worker with pid: 9527
But when I go to the browser and type in my instance public dns, I cannot connect to it. Could you please give me some hints on this? Thank you so much!