Skip to main content

Build Django management commands using the click CLI package.

Project description

Django Click

Project information:

https://img.shields.io/pypi/v/django-click.svg https://img.shields.io/pypi/dm/django-click.svg https://img.shields.io/badge/docs-TODO-lightgrey.svg https://img.shields.io/pypi/l/django-click.svg

Automated code metrics:

https://img.shields.io/travis/GaretJax/django-click.svg https://img.shields.io/coveralls/GaretJax/django-click/master.svg https://img.shields.io/codeclimate/github/GaretJax/django-click.svg https://img.shields.io/requires/github/GaretJax/django-click.svg

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: http://click.pocoo.org/7/

  • Compatible with Django 2.2 or 3.0 running on Python 3.6, 3.7, 3.8, 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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-click-2.2.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_click-2.2.0-py2.py3-none-any.whl (7.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file django-click-2.2.0.tar.gz.

File metadata

  • Download URL: django-click-2.2.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.2

File hashes

Hashes for django-click-2.2.0.tar.gz
Algorithm Hash digest
SHA256 cd10bc23e2b49c7a934c3b20f1062ab5dbab78d72efbd316c5fd00fea51d902f
MD5 fdd77ba4e5175bbbd936ba980da1b7b1
BLAKE2b-256 25fc2793452a7052027500f6b6c9e26bb5142fd6c566d779f531e70281ab582d

See more details on using hashes here.

File details

Details for the file django_click-2.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: django_click-2.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.2

File hashes

Hashes for django_click-2.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 159a3d411ef96c27278377b1bf5e60b5b4bcb884dbeb4b5e5efe2200ad051f5f
MD5 9329800bb8f9b522e04893afaccd1d7f
BLAKE2b-256 a6204c2387790445ab2ca527dff07e5c4bc74de948e6da4bcefdd714a0e7e17b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page