Ticket #18187: 18187-1.diff

File 18187-1.diff, 749 bytes (added by Claude Paroz, 6 years ago)

Added paragraph about command options

  • docs/howto/custom-management-commands.txt

    diff --git a/docs/howto/custom-management-commands.txt b/docs/howto/custom-management-commands.txt
    index 74b67b2..ab3c0d4 100644
    a b must be added to :attr:`~BaseCommand.option_list` like this: 
    9797            )
    9898        # ...
     100The option (``delete`` in our example) is then available in the options dict
     101parameter of the handle method. See the :py:mod:`optparse` Python documentation
     102for more about ``make_option`` usage.
    100104In addition to being able to add custom command line options, all
    101105:doc:`management commands</ref/django-admin>` can accept some
    102106default options such as :djadminopt:`--verbosity` and :djadminopt:`--traceback`.
Back to Top