Skip to main content

djangoplay-cli

Maintained by DjangoPlay

PyPI Python License Django Lint

djangoplay-cli is a developer command-line interface for managing local development environments within the DjangoPlay ecosystem.

The CLI simplifies common developer workflows such as:

  • starting HTTP and HTTPS development servers
  • regenerating SSL certificates
  • managing Celery workers
  • validating environment dependencies
  • resetting development services
  • streaming application logs
  • orchestrating local development processes

The goal is to provide a simple, predictable, and portable developer tool without introducing complex infrastructure dependencies.


Philosophy

This project follows several guiding principles:

  • Minimal configuration
  • No secrets in the repository
  • Clear command structure
  • Stable developer experience
  • Incremental releases
  • Developer-first ergonomics

The CLI is designed to remove repetitive setup tasks so developers can focus on application development instead of environment management.


Supported Platforms

Platform Status
macOS Supported
Linux Supported
Ubuntu Supported
Windows (WSL) Supported
Windows native Limited

Installation

Install from PyPI:

pip install djangoplay-cli

Verify installation:

dplay --version

Example output:

1.0.5

CLI Overview

dplay
├── http
├── ssl
├── certs
├── logs
│
├── dev
│    └── worker
│
└── system
     ├── doctor
     └── reset

Development Commands

These commands manage the Django development environment.


Start HTTP development server

dplay http

Performs the following automatically:

  • encrypts environment variables from ~/.dplay/
  • flushes Redis cache
  • collects static files
  • restarts Celery worker and beat
  • waits until Celery is ready
  • stops any existing Django server on the configured port
  • opens the browser
  • starts the Django development server

The server URL is automatically derived from ~/.dplay/config.yaml.

Example:

http_protocol: http
http_port: 3333
http_url: localhost

Start HTTPS development server

dplay ssl

Performs the same startup sequence as dplay http, plus:

  • checks for SSL certificates under ~/.dplay/ssl/
  • generates certificates if necessary
  • automatically trusts certificates on macOS, Linux, and WSL
  • launches Django using runserver_plus

The HTTPS URL is read from your configuration.

If certificates cannot be generated:

TLS certificate unavailable. Use dplay http

Start Celery worker

dplay dev worker

Starts the Celery worker in the foreground.


Regenerate SSL certificates

dplay certs

Regenerates SSL certificates from the current configuration without restarting the development server.

Useful after adding new subdomains:

subdomains:
  extra_domains:
    - issues.localhost
    - docs.localhost

Then run:

dplay certs
dplay ssl

The generated certificate is automatically trusted on supported platforms.


Stream application logs

dplay logs
dplay logs [APP]

Streams and pretty-prints application logs with colorized output by log level.

Examples:

dplay logs
dplay logs users
dplay logs mailer --level ERROR
dplay logs django --no-follow -n 100

Options:

Option Default Description
APP django Application log to stream
--lines, -n 50 Historical lines shown initially
--level, -l Filter by log level
--follow / --no-follow follow Stream new log entries

Applications are discovered automatically from backend/logs/.


System Commands

Environment diagnostics

dplay system doctor

Checks:

  • Python version
  • Redis availability
  • PostgreSQL availability
  • Celery installation

Reset development environment

dplay system reset

Performs:

  • stops Celery workers
  • stops Celery beat
  • flushes Redis

CLI Help

dplay --help

Development commands:

dplay dev --help

System commands:

dplay system --help

Project Structure

djangoplay-cli/

dplay/
├── commands/
├── core/
├── environment/
└── utils/

Architecture

Layer Responsibility
CLI Commands User-facing commands
Core Repository detection, process management
Environment Environment validation
Utils SSL, logging, Redis, browser, startup orchestration

The modular architecture keeps the CLI maintainable while allowing new commands to be added with minimal coupling.


Development Setup

Clone the repository:

git clone https://github.com/binaryfleet/djangoplay-cli.git
cd djangoplay-cli

Install locally:

pip install -e .

Install development tools:

pip install ruff pytest

Run linting:

ruff check .

Run tests:

pytest

Security

This project follows strict security practices:

  • no credentials stored in the repository
  • no secrets generated automatically
  • no credentials written to disk
  • SSL certificates generated only for local development

Versioning

This project follows Semantic Versioning.

v0.x  Experimental
v1.x  Stable

License

Licensed under the MIT License.

See the LICENSE file for details.

Download files

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

Source Distribution

djangoplay_cli-1.0.5.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

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

djangoplay_cli-1.0.5-py3-none-any.whl (26.1 kB view details)

Uploaded Python 3

File details

Details for the file djangoplay_cli-1.0.5.tar.gz.

File metadata

  • Download URL: djangoplay_cli-1.0.5.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.15

File hashes

Hashes for djangoplay_cli-1.0.5.tar.gz
Algorithm Hash digest
SHA256 3b8f0d60af13bf4ff6c6f7ea388587dbeba90f204a6ac385afd716a7d7e09a50
MD5 3e6c18fd36612a783896b27a9064810d
BLAKE2b-256 c0203cb28ea0fd325789407e6aa42873ecd4a9b70714ca04229a5c49eb25d813

See more details on using hashes here.

File details

Details for the file djangoplay_cli-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: djangoplay_cli-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 26.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.15

File hashes

Hashes for djangoplay_cli-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 81cf330d0c39af764ae2791b34938dcac98ab3b4cb10974dfc44359c4c569d92
MD5 bdd26c8e2c9dda2a73d2011c15f2def1
BLAKE2b-256 f065631b5c0caac6cba65a02eb6256bef54877820658e8590559d3d0578f127a

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.6

2 files

This release

1.0.5 This release

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

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