Skip to main content

Build Django management commands using the click CLI package.

Project description

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/coveralls/GaretJax/django-click/master.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: 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.

Release Notes and Contributors

This package is a member of Django Commons and adheres to the community’s Code of Conduct. It is maintained by Jonathan Stoppani and Timothy Allen, who have many professional responsibilities. We are thrilled that our employers allow us a certain amount of time to contribute to open-source projects. We add features as they are necessary for our projects, and try to keep up with Issues and Pull Requests as best we can. Due to constraints of time (our full time jobs!), Feature Requests without a Pull Request may not be implemented, but we are always open to new ideas and grateful for contributions and our users.

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.4.1.tar.gz (8.7 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.4.1-py2.py3-none-any.whl (7.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file django_click-2.4.1.tar.gz.

File metadata

  • Download URL: django_click-2.4.1.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.9

File hashes

Hashes for django_click-2.4.1.tar.gz
Algorithm Hash digest
SHA256 5b989ca791689391e6744f8a4dda9bc0aac06670f408c45794d6b83fbe7577ce
MD5 c25cc5426ca32c6fa10b13592dfef501
BLAKE2b-256 2ebbf47eb64d008805195a5d44a2fb306638a84e673dd5fd4ee738b05fa3a55b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_click-2.4.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.9

File hashes

Hashes for django_click-2.4.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 80cfa57af0fae29a3d47f20a74d71aecd1f0bf299549cddb97d98a949e130f01
MD5 8b5ead9725623328125366480e852406
BLAKE2b-256 94f13bffa13296a9ee51a266e49db00a7defb64f613d68a80cdb2d50721f4b65

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