Skip to content

Latest commit

 

History

History
72 lines (47 loc) · 2.09 KB

README.rst

File metadata and controls

72 lines (47 loc) · 2.09 KB

Django Click

Project information:

Automated code metrics:

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

  • Free software: MIT license
  • Documentation: http://django-click.rtfd.org (TODO)
  • Compatible with Django 1.4, 1.5, 1.6, 1.7 and 1.8, running on Python 2.7, 3.4 and PyPy

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.