File tree Expand file tree Collapse file tree 1 file changed +27
-2
lines changed
Expand file tree Collapse file tree 1 file changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,13 @@ python -m pip install django-tasks
1818
1919The first step is to add ` django_tasks ` to your ` INSTALLED_APPS ` .
2020
21+ ``` python
22+ INSTALLED_APPS = [
23+ # ...
24+ " django_tasks" ,
25+ ]
26+ ```
27+
2128Secondly, you'll need to configure a backend. This connects the tasks to whatever is going to execute them.
2229
2330If omitted, the following configuration is used:
@@ -100,7 +107,21 @@ To disable queue name validation, set `QUEUES` to `[]`.
100107
101108### The database backend worker
102109
103- First, you'll need to add ` django_tasks.backends.database ` to ` INSTALLED_APPS ` , and run ` manage.py migrate ` .
110+ First, you'll need to add ` django_tasks.backends.database ` to ` INSTALLED_APPS ` :
111+
112+ ``` python
113+ INSTALLED_APPS = [
114+ # ...
115+ " django_tasks" ,
116+ " django_tasks.backends.database" ,
117+ ]
118+ ```
119+
120+ Then, run migrations:
121+
122+ ``` shell
123+ ./manage.py migrate
124+ ```
104125
105126Next, configure the database backend:
106127
@@ -112,7 +133,11 @@ TASKS = {
112133}
113134```
114135
115- Finally, you can run ` manage.py db_worker ` to run tasks as they're created. Check the ` --help ` for more options.
136+ Finally, you can run the ` db_worker ` command to run tasks as they're created. Check the ` --help ` for more options.
137+
138+ ``` shell
139+ ./manage.py db_worker
140+ ```
116141
117142### Retrieving task result
118143
You can’t perform that action at this time.
0 commit comments