Skip to main content

A CLI tool for Django development

Project description

djazz-cli

djazz-cli is a Django command-line tool that extends and enhances Django's built-in management commands. It provides a simpler, more intuitive interface through the dj command.

Features

  • Simplified project creation with template support
  • Enhanced app creation with better defaults
  • Shorter, more intuitive command syntax
  • Helpful next-step guidance after commands
  • Default templates with common configurations

Installation

Install using pip:

pip install djazz-cli

Usage

Creating a New Project

# Basic project creation (in current directory)
dj startproject myproject

# Create project with a specific template
dj startproject myproject template_name

# Create project in a specific directory
dj startproject myproject template_name path/to/directory

Creating a New App

# Basic app creation
dj startapp myapp

# Create app with a specific template
dj startapp myapp template_name

# Create app in a specific directory
dj startapp myapp template_name path/to/directory

Motivation

The django-admin CLI is a powerful tool for managing Django projects, but it has some limitations:

  1. The default app template lacks common files like urls.py
  2. Project creation always creates a nested directory structure
  3. Template usage requires verbose command-line options

djazz-cli addresses these issues by:

  • Providing better default templates
  • Simplifying the command interface
  • Creating projects in the current directory by default
  • Making template usage more straightforward

Templates

Project Templates

  • default: Enhanced version of Django's default project template

App Templates

  • default: Extended app template with additional files (urls.py, etc.)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Development

Setting Up Development Environment

# Clone the repository
git clone https://github.com/djazzcc/cli.git
cd cli

# Create and activate a virtual environment
python -m venv .venv
source .venv/bin/activate  # On Unix/macOS
# or
.\.venv\Scripts\activate  # On Windows

# Install development dependencies
uv pip install -e .

Local Testing

# Create a sandbox test environment
mkdir -p sandbox/test1
cd sandbox/test1

# Create and activate a virtual environment
python -m venv .venv
source .venv/bin/activate  # On Unix/macOS
# or
.\.venv\Scripts\activate  # On Windows

# Install the package in editable mode (from project root)
cd ../..  # Go back to project root
uv pip install -e .

# Verify installation
uv pip list | grep djazz-cli

# Test the CLI
cd sandbox/test1
dj startproject myproject

Project Structure

cli/
├── djazz_cli/
│   ├── __init__.py
│   ├── main.py
│   └── templates/
│       ├── app_templates/
│       │   └── default/
│       └── project_templates/
│           └── default/
├── sandbox/          # For local testing (git ignored)
├── pyproject.toml
├── README.md
└── .gitignore

Building the Package

# Build both wheel and sdist
uv build

# The built packages will be in the dist/ directory
ls dist/

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

djazz_cli-0.1.1.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

djazz_cli-0.1.1-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file djazz_cli-0.1.1.tar.gz.

File metadata

  • Download URL: djazz_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for djazz_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 dafe5609759b37eb06b3fa8e8dc1aa682ff9964a4e93eafc8ab141affe1348a1
MD5 a6cbf6fb7559e4478b2f1616b23ab626
BLAKE2b-256 d5bb230a440a6e6f2284cc834424b9c6a61d4a9d357b579db147a1eb1b73789b

See more details on using hashes here.

File details

Details for the file djazz_cli-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: djazz_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for djazz_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 62227e14de96beb6a0e279f197d8e33012bc5fd8226b30a5cc02242683873dea
MD5 55a125c8608b9ed80df228572d07c2b4
BLAKE2b-256 f3cb9161e8f7db8eca7413a36b85696cfd03a6eb6de11acd8ec6bec891ef895a

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