A simple alternative for celery that doesn't require a broker.
See https://www.bugsink.com/snappea-design/
-
Add
snappea
to yourINSTALLED_APPS
. -
Add a "snappea" DATABASE to your settings, and route snappea traffic to it:
DATABASES = {
[..]
"snappea": {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'snappea.sqlite3',
'OPTIONS': {
'timeout': 5,
},
},
}
DATABASE_ROUTERS = ("snappea.dbrouters.SeparateSnappeaDBRouter",)
- Create the tables:
python manage.py migrate --database=snappea
- Start the snappea background process:
python manage.py runsnappea
- In another Window, fire off a task to test that it works:
python manage.py shell
Python [..] (main, [..]
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from snappea.example_tasks import printing_task
>>> printing_task.delay()
You should now see text in your snappea console.
- Django-only
- Linux-only.