Run a local command.

    Examples:

    $ django run manage.py runserver

    ...

def run(quiet, args):
    """Run a local command.

    Examples:

    $ django run manage.py runserver

    ...
    """
    if not args:
        raise ClickException('pass a command to run')

    cmd = ' '.join(args)
    application = get_current_application()
    name = application.name
    settings = os.environ.get('DJANGO_SETTINGS_MODULE', '%s.settings' % name)
    return application.run(
        cmd,
        verbose=not quiet,
        abort=False,
        capture=True,
        env={
            'DJANGO_SETTINGS_MODULE': settings
        }
    )