How to make djangoQ run as a service using systemd

Viewed 683

How to make DjangoQ run as a service using systemd?

There is a gap, djangoQ installation and running is like learning to run a Django project. But now, you want to push the project which is using DjangoQ to production.

The problem is you are not aware of server and Linux, maybe you are even coming from Windows....

So can somebody tell us, How to run DjangoQ in ubuntu using systemd

I am getting the error that ExecStart path is not absolute... I came from here:

Stack Question

But that answer is not complete, too much tacit knowledge unshared...

[Unit]
Description= Async Tasks Runner
After=network.target remote-fs.target

[Service]
ExecStart=home/shreejvgassociates/ot_britain_college/env/bin/python manage.py qcluster --pythonpath home/shreejvgassociates/ot_britain_college/OverTimeCollege --settin$
RootDirectory=home/shreejvgassociates/ot_britain_college/OverTimeCollege
User=shreejvgassociates
Group=shreejvgassociates
Restart=always

[Install]
WantedBy=multi-user.target

1 Answers

It works well. Try it.

[Unit]
Description=Django-Q Cluster for site TestSite
After=multi-user.target

[Service]
Type=simple
ExecStart=/home/test/TestSite/venv/bin/python3 /home/test/TestSite/manage.py qcluster

[Install]
WantedBy=multi-user.target
Related