djangoplay-cli
Maintained by DjangoPlay
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 webapp/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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file djangoplay_cli-1.0.6.tar.gz.
File metadata
- Download URL: djangoplay_cli-1.0.6.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7468f4e24467ab2186c519e4959471f63a915b4dc5f2cc0362c0dd435886c7e
|
|
| MD5 |
e5ebac30dd8b2dafb9743843be46b3fe
|
|
| BLAKE2b-256 |
de03dfe4c2069866d721f92f2c7aea5066fd57a9fedf59c3ff70276bc5eede36
|
File details
Details for the file djangoplay_cli-1.0.6-py3-none-any.whl.
File metadata
- Download URL: djangoplay_cli-1.0.6-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80e5ed4a934f293afb68c09ffb6b7f01f5575480afbe15280b574d4170bd9552
|
|
| MD5 |
e283b768f795c9620f763e0336bbcd49
|
|
| BLAKE2b-256 |
7cd19037771891cbf1526d3e23556569c7e1022e5dbb3efd383cc4b175c20917
|