Skip to main content

django-clite

A CLI tool that handles creating and managing Django projects

publish PyPI - Package PyPI - Python PyPI - License PyPI - Downloads

Installation

Install via pip:

pip install django-clite

After installation, the CLI will expose the binary with the name:

django-clite

Extending the CLI

Currently, there are two main ways of extending the functionality of the CLI:

  1. Adding your own commands/plugins
  2. Overriding the provided resource templates

Including your own commands

If you would like to extend the functionality of this CLI, you can include your own plugins/commands by setting an environment variable: DJANGO_CLITE_PLUGINS. Simply set this variable to the path where your plugins are.

Plugin commands are auto-discovered if they are placed under the plugins directory, but please be sure to do the following for this to work:

  1. Name your package and click command the same. That is, a package called get, for example, should define a get command.
  2. Place the command definition within the package's main.py module. For example:
# get/main.py
import click


@click.command()
@click.pass_context
def get(ctx):
    pass
  1. Sub-commands should be added to the top-most command group in the package's main.py module.
# get/main.py
import click


@click.group() # <- group
@click.pass_context
def get(ctx):
  pass


@click.command()
@click.pass_context
def foo(ctx):
  pass


get.add_command(foo)
  1. Access your commands via your top-most command group.
django-clite get foo

NOTE: If you would like to skip a plugin/command from being auto-discovered, simply rename the package by either prepending or appending any number of underscores (_). Any code contained within the package will be ignored.

Overriding the templates

The flag --templates-dir can be used to configure an additional path wherein the CLI can look for resource templates. Alternatively, you can use the environment variable DJANGO_CLITE_TEMPLATES_DIR for the same purpose.

Take a look at the template files directory for a reference of what files can be overriden. The paths of the templates you wish to override need to match the provided template. For example, if you wish to override the model template, which is defined under src/cli/template_files/models/model.tpl, you should define your own model template under your desired directory, i.e /path/to/templates/models/model.tpl.

Development

Install from source:

git clone https://github.com/oleoneto/django-clite.git
cd django-clite
pip install --editable .

Dependencies

Check out pyproject.toml for all installation dependencies.

Interactive Docs

In order to maintain consistency in our documentation of all the different commands and features of the CLI, we've decided to move the README to a series of Jupyter notebooks which you can explore per command under the docs directory.

To Do

Check out our open issues.

Pull requests

Found a bug? See a typo? Have an idea for new command? Feel free to submit a pull request with your contributions. They are much welcome and appreciated.

LICENSE

django-clite is BSD Licensed.

Release files for django-clite 0.19.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-clite 0.19.7
File Size Uploaded
django_clite-0.19.7.tar.gz 47.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-clite 0.19.7
File Interpreter ABI Platform
django_clite-0.19.7-py3-none-any.whl Python 3 none any Details

Total release size: 128.7 kB

Release files / django_clite-0.19.7.tar.gz

Download URL django_clite-0.19.7.tar.gz
Size 47.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b88d662ca10049432c772652a7552b82bd5c691157c73e73a690828ae3fa23c6
BLAKE2b-256 checksum
How to use checksums
b1f2e35c6bcd14b39dfd37d788ca8319e553934a7a6f634d6d6f53ade804563d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / django_clite-0.19.7-py3-none-any.whl

Download URL django_clite-0.19.7-py3-none-any.whl
Size 80.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
df28286537c4571a24b26cd6e11d9a8d5a7d25010492c38ea7260aa04a23f022
BLAKE2b-256 checksum
How to use checksums
9624e68367109bffde99fae5183490c84591974b93f578b8f464238830611691
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

0.19.7 This release

2 release files

0.19.4

2 release files

0.19.2

2 release files

0.19.1

2 release files

0.19.0

2 release files

0.18.1

2 release files

0.17.0

2 release files

0.16.1

2 release files

0.16.0

2 release files

0.13.0

2 release files

0.3.0

2 release files

0.2.11

2 release files

0.2.10

1 release file

0.2.9

1 release file

0.2.7

1 release file

0.2.4

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page