title: python django create own command and add list as parameter
body: <p>I want to use py manage.py own_command.</p>
  <p>I got the following code:</p>
  <pre><code>from django.core.management.base import BaseCommand
  
  
  class Command(BaseCommand):
      help = 'create user'
  
      def add_arguments(self, parser):
          parser.add_argument('--username', type=str, help='set username')
          parser.add_argument('--password', type=str, help='set password')
          parser.add_argument('--email', type=str, help='set password')
          parser.add_argument('--group', type=list, default=[], action='append', help='set group(s) like [&quot;basic&quot;, &quot;advanced&quot;]')
          parser.add_argument('--permission', type=list, default=[], action='append', help='set permission(s) like [&quot;delete&quot;, &quot;write&quot;]')
  </code></pre>
  <pre><code>
  &gt;py manage.py create_app_user --username dustin --password hdf --email &quot;&quot; --group [&quot;admin&quot;, &quot;basic&quot;
  ]
  </code></pre>
  <p>creates</p>
  <blockquote>
  <pre><code>usage: manage.py create_app_user [-h] [--username USERNAME]
                                   [--password PASSWORD] [--email EMAIL]
                                   [--group GROUP] [--permission PERMISSION]
                                   [--version] [-v {0,1,2,3}]
                                   [--settings SETTINGS]
                                   [--pythonpath PYTHONPATH] [--traceback]
                                   [--no-color]
  manage.py create_app_user: error: unrecognized arguments: basic
  </code></pre>
  </blockquote>
  <p>]</p>
  <p>I found solutions for django &lt;= 1.7 BUT not for &gt;=2.1</p>