argparse parses the strings supplied by an operating system and turns them into positional arguments and flags. Django management commands wrap it, so commands register inputs through a parser instead of building argument handling from scratch. section 9.3
A Django management command typically:
- Overrides add_arguments() and receives the already-created parser. section 9.3
- Calls add_argument() for each positional argument or flag; leading dashes identify flags, and a second name can provide an abbreviation. section 9.3
- Reads filters such as --last_name, -l, --first_name, -f, and --birth, then uses the resulting values in the command. section 9.3
Filtering a musicians command
python manage.py musicians --last_name Loblaw returns matching musicians; combining --first_name O with --last_name B narrows the result. An invalid value such as --birth tomorrow produces CommandError with a date-format message.


