Skip to content

Commit 8c4ecc8

Browse files
authored
Pull out example snippets and commands in README (#82)
1 parent 471cc22 commit 8c4ecc8

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ python -m pip install django-tasks
1818

1919
The first step is to add `django_tasks` to your `INSTALLED_APPS`.
2020

21+
```python
22+
INSTALLED_APPS = [
23+
# ...
24+
"django_tasks",
25+
]
26+
```
27+
2128
Secondly, you'll need to configure a backend. This connects the tasks to whatever is going to execute them.
2229

2330
If 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

105126
Next, 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

0 commit comments

Comments
 (0)