Create a Django management command with django-click
masterTo create a management command using click, create a file in <yourapp>/management/commands/<command_name>.py. Instead of defining a class, import djclick as click and use standard click decorators (like @click.command(), @click.argument(), etc.) on a function named command.
Django will then recognize this as a management command that can be invoked via ./manage.py <command_name>.
import djclick as click
@click.command()
@click.argument('name')
def command(name):
click.secho(f'Hello, {name}', fg='red')