Q:

Django call_command() with filename wildcard

How can you use filename wildcards in call_command()?  I'm trying to create a management command that does the same as python manage.py loaddata */fixtures/*.json
Below code throws CommandError: No fixture named '*' found. 
from django.core.management import call_command
from django.core.management.base import BaseCommand

class Command(BaseCommand):
    help = 'Load all fixtures in app directories'

    def handle(self, *args, **kwargs):
        call_command('loaddata', '*/fixtures/*.json')
        self.stdout.write('Fixtures loaded\n')

A:

The glob input in python manage.py loaddata */fixtures/*.json command works because the glob is expanded by bash; if you try escaping the glob, e.g. python manage.py loaddata '*/fixtures/*.json', the command should fail with the same error message. 
Instead, expand the globs on Python side, for example:
import pathlib

class Command(BaseCommand):
    help = 'Load all fixtures in app directories'

    def handle(self, *args, **kwargs):
        cmd_args = list(pathlib. Path().glob('*/fixtures/*.json'))
        call_command('loaddata', *cmd_args)

