Installation¶
Requirements¶
- Python 3.8+
- Django 3.2+
Install the Package¶
Configure Django¶
1. Add to INSTALLED_APPS¶
Add django_simple_queue to your INSTALLED_APPS in settings.py:
INSTALLED_APPS = [
# Django apps...
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
# Third-party apps...
'django_simple_queue',
# Your apps...
'myapp',
]
2. Add URL Configuration¶
Include the task status URL in your urls.py:
from django.urls import path, include
urlpatterns = [
# ...
path('django_simple_queue/', include('django_simple_queue.urls')),
]
3. Run Migrations¶
Apply the database migrations to create the Task table:
Start the Worker¶
Run the worker command to start processing tasks:
Running in Production
In production, use a process manager like systemd, supervisor, or Docker to keep the worker running. You can run multiple workers for parallel processing.
Verify Installation¶
-
Create a simple task function:
-
Enqueue a task from Django shell:
-
Check the task status at
/django_simple_queue/task?task_id=<task_id>or in the Django admin.
Next Steps¶
- Configure settings for task timeouts, allowed tasks, etc.
- Learn how to create tasks in your application
- Understand the task lifecycle