Question
Please help with creating gunicorn systemd Service File
For a while I am struggling with putting my django website into production (and it drives me insane). After trying bunch of different tutorials now I am trying this one: https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04
I am stuck on step where I have to configure Gunicorn systemd Service File, but since my project structured a bit different than in the tutorial I can’t find a way to correctly do it. Please help me find a way for it. For this project user named: gdmin and the directories are:
skdir/myenv/
- for virtual enviroment
skdir/STV_skaiciuokle/skaiciuokle_web
- in here manage.py is held
skdir/STV_skaiciuokle/skaiciuokle_we/skaiciuokle_web
- in here settings.py
and wsgi.py
are held.
My current gunicorn.service configured like this (not working):
[Unit]
Description=gunicorn daemon
After=network.target
[Service]
User=gdmin
Group=www-data
WorkingDirectory=/home/gdmin/skdir
ExecStart=/home/gdmin/skdir/myenv/bin/gunicorn --access-logfile - --workers 3 --bind unix:/home/gdmin/skdir/STV_skaiciuokle/skaiciuokle_web/skaiciuokle_web.sock skaiciuokle_web.wsgi:application
[Install]
WantedBy=multi-user.target
How to correctly configure it?
P.S. I am sorry (once again) for not formatting everything since I get formatting tool to work on chrome. How do I fix it?
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.
×
Also I forgot to mention, that I posted similar question on https://askubuntu.com/questions/1179698/please-help-with-creating-gunicorn-systemd-service-file (with no answers so far).
Hi, it is a challenging project getting any website live.
What OS is your Droplet running? What kind of errors, if any, are you seeing when you try to start the service?
Reviewing the tutorial now against your config to see if I can spot any obvious errors.
The Community site supports “markdown” formatting for code blocks, similar to this with the backticks:
https://help.github.com/en/articles/creating-and-highlighting-code-blocks