allen-munsch / django-click

Write Django management command using the click CLI library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Django Click

Project information:

Automated code metrics:

django-click is a library to easily write Django management commands using the click command line library.

Installation

pip install django-click

Example

Create a command module as you would usually do, but instead of creating a class, just put a djclick command into <yourapp>/management/commands/helloworld.py:

import djclick as click

@click.command()
@click.argument('name')
def command(name):
    click.secho('Hello, {}'.format(name), fg='red')

And then call the command with:

$ ./manage.py helloworld django-click
Hello, django-click

Check out the test commands for additional example commands and advanced usage.

About

Write Django management command using the click CLI library

License:MIT License


Languages

Language:Python 100.0%