@@ -124,15 +124,15 @@ Example:
124
124
125
125
``` python
126
126
MANAGEMENT_COMMANDS_PATHS = {
127
- " mycommand " : " mysite.commands.MyCommand" ,
127
+ " my-command " : " mysite.commands.MyCommand" ,
128
128
}
129
129
```
130
130
131
- You can now run the custom command ` mycommand ` implemented in the ` MyCommand ` class
131
+ You can now run the custom command ` my-command ` implemented in the ` MyCommand ` class
132
132
from the ` mysite.commands ` module:
133
133
134
134
``` console
135
- python manage.py mycommand
135
+ python manage.py my-command
136
136
```
137
137
138
138
> In Django, the class representing a command must be named ` Command ` . The plugin
@@ -141,8 +141,8 @@ python manage.py mycommand
141
141
142
142
** Important Notes:**
143
143
144
- - All keys and values must be valid Python identifiers and absolute dotted paths,
145
- respectively.
144
+ - All keys and values must be valid Python identifiers (with hyphens allowed) and
145
+ absolute dotted paths, respectively.
146
146
- Paths must point to command classes, not modules.
147
147
- Commands must subclass ` django.core.management.base.BaseCommand ` .
148
148
- This setting takes precedence over others when discovering commands.
@@ -214,26 +214,26 @@ Example:
214
214
215
215
``` python
216
216
MANAGEMENT_COMMANDS_ALIASES = {
217
- " fullcheck " : [
217
+ " full-check " : [
218
218
" check --fail-level ERROR --deploy" ,
219
219
" makemigrations --check --dry-run --no-input" ,
220
220
" migrate --no-input" ,
221
221
],
222
222
}
223
223
```
224
224
225
- You can now execute all the commands aliased by ` fullcheck ` with a single command:
225
+ You can now execute all the commands aliased by ` full-check ` with a single command:
226
226
227
227
``` console
228
- python manage.py fullcheck
228
+ python manage.py full-check
229
229
```
230
230
231
231
Aliases can refer to commands defined in the ` MANAGEMENT_COMMANDS_PATHS ` setting
232
232
or other aliases.
233
233
234
234
** Important Notes:**
235
235
236
- - Keys must be valid Python identifiers.
236
+ - Keys must be valid Python identifiers (with hyphens allowed) .
237
237
- Values should be command expressions with parsable arguments and options.
238
238
- Circular references within aliases are not allowed, as they lead to infinite recursion.
239
239
0 commit comments