Write Django management command using the click CLI library
Project description
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.
History
1.2.0 - 2016-05-19
Allow custom lookups on ModelInstance parameter types.
1.1.0 - 2016-02-04
Add a ModelInstance parameter type to automatically retrieve model instances by their primary key
1.0.0 – 2015-09-14
Support for command groups
Added a pass_verbosity decorator
Improved test suite
0.1.1 – 2015-09-11
Django 1.4, 1.5, 1.6, 1.7 and 1.8 compatibility
Python 2.7 and 3.4 compatibility
100% coverage test suite
0.1.0 – 2015-09-10
Initial release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django-click-1.2.0.tar.gz.
File metadata
- Download URL: django-click-1.2.0.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cb4b3a4a64ff3751f45fe588681f02bdeb4d22b1e310b17570bc428dadb3c3c
|
|
| MD5 |
460a272501bd7d21eac07020e00c4476
|
|
| BLAKE2b-256 |
ed677d2bafdf6b3fb4649b62eb11c316e6edf87b47bb9aa30bf974222b3aa612
|
File details
Details for the file django_click-1.2.0-py2.py3-none-any.whl.
File metadata
- Download URL: django_click-1.2.0-py2.py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b6a35c22ab6895b9422dab34e51700628670bd01212ad731b77ae7144bf637d
|
|
| MD5 |
0c3e88e085a4f4408c28471ce2f30e6c
|
|
| BLAKE2b-256 |
144618ad03bad56f01b37b4f0d0db1beade5785b175f6d87c1c05f190914ec3a
|