I got a custom command in my reusable django app which I want to kick off a deamonized service and then return, leaving the service running.
I've implemented my service as a simple class with a start-method. When start is called it runs in an eternal loop, sleeping for 10 seconds, then using the django orm to check the database configured in the projects settings.py file, checks for entries in a given folder.
I want to be able to:
./manage.py startservice
which kicks of my service and returns. Then in the same shell:
./manage.py runserver
and start adding entries in a spefici database table which within 5 seconds are picked up by the service running in the background and processed.
I've looked at celery for a more message-queue-based approach, but it relies on too much other stuff. It`s important that the whole thing follows djangos reusable app pattern.
Any hints or thoughts?