How do I pass multiple arguments with values, from command line, to a custom django management command?
def add_arguments(self, parser):
parser.add_argument('str_arg1', nargs='+')
parser.add_argument('int_arg2', nargs='+', type=int)
When I run:
./manage.py my_command str_arg1 value int_arg2 1 --settings=config.settings.local
I get the following values in options
:
options['str_arg1'] = ['str_arg1', 'value', 'int_arg2']
options['int_arg2'] = [1]
Tried searching in documentation and online for a solution and multiple ways of passing the arguments with no luck. Django version is 1.10.
Thanks