Build Django management commands using the click CLI package.
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 for the Click command line library: https://click.palletsprojects.com/en/8.0.x/
Compatible with Django 4.2 and 5.0 running on Python 3.8, 3.9, 3.10, 3.11, and 3.12 (note: 3.10+ required for Django 5.0).
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
Unreleased
…
2.2.0 - 2020-04-14
Fix compatibility with latest click: remove __all__.
2.1.0 - 2018-04-20
Add experimental support for Django 2.0
2.0.0 - 2017-06-30
Drop support for unsupported Django versions (1.4, 1.5, 1.6, and 1.7).
Add official support for Django 1.10 and 1.11.
Add official support for python 3.5 (all Django versions) and 3.6 (Django 1.11 only).
Correctly handle click errors by outputting the formatted messages instead of a stack trace (#4).
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
File details
Details for the file django_click-2.4.0.tar.gz
.
File metadata
- Download URL: django_click-2.4.0.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef935b611040d123b60e88eb2952c4838b4538b14d248114128fcccb4418685d |
|
MD5 | d745b967a7a45f401685d1650e247fc5 |
|
BLAKE2b-256 | c3226197a48b9facca10ecdb95a9341721cd7a89548b7464ed06d6c527348a35 |
File details
Details for the file django_click-2.4.0-py2.py3-none-any.whl
.
File metadata
- Download URL: django_click-2.4.0-py2.py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c64a31cf25e54d3fccaea3af8d46d0b63511da2722e5888612aeee4d81e46d4 |
|
MD5 | 1e54ec9dbece06fadcab83ce1e1616ab |
|
BLAKE2b-256 | a72b295a2e4b5e7daef075cbb3b72bdbf3fe307fcb2c87213d2df8382fa039a7 |