[Django]-Django admin custom commands – passing a list of strings into args

10👍

The call_command method is using Arbitrary Arguments List for command arguments.

So, you need to use:

list = ['abc', 'def', 'ghi']
management.call_command('commandname', *list)

Which is the same than:

management.call_command('commandname', 'abc', 'def', 'ghi')

Related information:

👤math

Leave a comment