Question

.sock file not generating for Django application

Here is the hierarchy of the droplet: hierarchy Here is the gunicorn.service file: file

When I run the following commands, no .sock file is generated:

sudo systemctl start gunicorn sudo systemctl enable gunicorn

Tutorial: https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04#create-and-configure-a-new-django-project


Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
December 15, 2022

Hi there,

I would recommend following the troubleshooting steps form the tutorial that you’ve shared. Then feel free to share the output of the commands here.

Mainly the following steps:

  • Check the status of the process to find out whether it was able to start:
sudo systemctl status gunicorn
  • If the systemctl status command indicated that an error occurred or if you do not find the myproject.sock file in the directory, it’s an indication that Gunicorn was not able to start correctly.

  • Check the Gunicorn process logs by typing:

sudo journalctl -u gunicorn

Take a look at the messages in the logs to find out where Gunicorn ran into problems. There are many reasons that you may have run into problems, but often, if Gunicorn was unable to create the socket file, it is for one of these reasons:

https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04#check-for-the-gunicorn-socket-file

Let me know how it goes!

Best,

Bobby