Django and Gunicorn setup

I followed this video https://www.youtube.com/watch?v=NSHshIEVL-M and ran into problems when trying to curl the webpage. I thought it might be a firewall issue but since I'm running the curl command locally would that be an issue? I also ran which gunicorn from inside my environment and populated that the in the gunicorn.service file under ExecStart. I have shared my configs below any help is appreciated!

django setup:

(django_env) [django@ip-10-42-42-120 sec_web]$ ls
django_env  sec_web
(django_env) [django@ip-10-42-42-120 sec_web]$ ls sec_web
db.sqlite3  manage.py  sec_web  static

Gunicorn service config:

[Unit]
Description=gunicorn daemon
Requires=gunicorn.socket
After=network.target

[Service]
User=django
Group=www-data
WorkingDirectory=/home/django/sec_web
ExecStart=/home/django/sec_web/django_env/bin/gunicorn \
      --access-logfile - \
      --workers 3 \
      --bind unix:/run/gunicorn.sock \
      sec_web.wsgi:application

[Install]
WantedBy=multi-user.target

Gunicorn socket config:

[Unit]
Description=Security Web Project

[Socket]
ListenStream=/run/gunicorn.sock

[Install]
WantedBy=sockets.target

Curl command output:

(django_env) [django@ip-10-42-42-120 sec_web]$ sudo curl --unix- 
socket /run/gunicorn.sock localhost
curl: (7) Couldn't connect to server
Back to Top