0

I developed simple web page using django and for second week struggling trying to launch it. I have no background in server managing so everything I do is new to me. During my trials I have read countless tutorials and did not managed to get my website up and running (and it drives me insane). For now I am trying to follow this tutorial. I am at the part there I need to create Gunicorn systemd Service File, but because my project structure is little bit different I can't figure way how to do it correctly.

My project structure would be like this: user: gdmin

Everything held in parent folder named skdir and in subfolders within in it. Below I tried to visualize it in tree view structure (not all files shown, just the ones i thought important):

skdir/
     myenv/
          bin/
             gunicorn    
     STV_skaiciuokle/
                    skaiciuokle_web/
                                   manage.py
                                   skaiciuokle_web/
                                                  settings.py
                                   static/
                                         js
                                         css
                                         img
                                   media

To make everything more clear my manage.py file is in skdir/STV_skaiciuokle/skaiciuokle_web directory.

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 should I correct it?

Also can somebody recommend good tutorial on this, something like "deploy Django for dummies" level?

0

Finally got it running myself.

Problem was that socket file was not being created. During my research I noticed that init.py files were not present since then I uploaded my project to github it discarded them as empty and unnecessary. I fixed this and it seems that was the root of my problem in the first place. After this I finally got site up and running.

To think about it, probably this was a problem all along and other tutorials probably would had worked also...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.