CLI for Django and SaaS Pegasus
Project description
pegasus-cli
Demo
A demo is worth 1,000 words. Click the image below to see the Pegasus CLI in action:
Overview
The Pegasus CLI is a command-line tool that streamlines the process of working in a Django project. It is currently designed to work with the SaaS Pegasus Django boilerplate, but can be used more generally for any Django project (and will be updated to work with generic Django projects in the future).
It is currently geared around the startapp
command. This will create a new app in your Django project,
and (optionally) spin up an entire Create / Update / Delete (CRUD) interface for it, built with
Django forms and HTMX.
Example usage:
pegasus startapp todos Project Todo
This will create a todos
app in your Django project with models, URLs, views and templates to
work with a Project
and Todo
model.
Installation
Install this tool using pip
:
pip install pegasus-cli
Usage
For help, run:
pegasus --help
You can also use:
python -m pegasus --help
Configuration
You can run pegasus startapp --help
for configuration options.
In addition to the command-line options, you can also set default values for configuration
options by creating a pegasus-config.yaml
file in your project directory.
The format of the file is:
cli:
app_directory: apps
module_path: apps
template_directory: templates
base_model: apps.teams.models.BaseTeamModel
use_teams: true
The above configuration is the recommended configuration for SaaS Pegasus projects
(with teams turned on, else set use_teams: false
and base_model: apps.utils.models.BaseModel
).
A recommended default configuration for your project will be included in your project's pegasus-config.yaml
file if you are on Pegasus version 2024.9 or later.
The Pegasus config will create your apps in the apps
directory, and will use the templates
directory for your templates.
Development
To contribute to this tool, first checkout the code. Then create a new virtual environment:
cd cli
python -m venv venv
source venv/bin/activate
Now install the dependencies and dev dependencies:
pip install -e '.[dev]'
To run the tests:
pytest
Setup pre-commit hooks:
pre-commit install
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file pegasus_cli-0.6.tar.gz
.
File metadata
- Download URL: pegasus_cli-0.6.tar.gz
- Upload date:
- Size: 16.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ee3fcff79c12d880a3aeff76a567c0be99d9f7f6f6960aecd99e95fa0cbc8ef |
|
MD5 | 2aca9be57ea45372c07fab89d1c0ebff |
|
BLAKE2b-256 | 775dc52327d551a20a8c8e0ebe2f04fcf18106e2cbb9c70af62d523134c01542 |
Provenance
The following attestation bundles were made for pegasus_cli-0.6.tar.gz
:
Publisher:
publish.yml
on saaspegasus/pegasus-cli
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
pegasus_cli-0.6.tar.gz
- Subject digest:
8ee3fcff79c12d880a3aeff76a567c0be99d9f7f6f6960aecd99e95fa0cbc8ef
- Sigstore transparency entry: 145789339
- Sigstore integration time:
- Predicate type:
File details
Details for the file pegasus_cli-0.6-py3-none-any.whl
.
File metadata
- Download URL: pegasus_cli-0.6-py3-none-any.whl
- Upload date:
- Size: 21.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 351b3efe1643e4dc93d267bde1a1c5cd2ef6b84806ce6728d1b062bf76d4c577 |
|
MD5 | 03c5eff74d3b9db46c935da86bc8a09a |
|
BLAKE2b-256 | 55bdaf6819008f09a2c75003f0ee81efd2cffd50cb1ab03a0d822f8f0e4616ee |
Provenance
The following attestation bundles were made for pegasus_cli-0.6-py3-none-any.whl
:
Publisher:
publish.yml
on saaspegasus/pegasus-cli
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
pegasus_cli-0.6-py3-none-any.whl
- Subject digest:
351b3efe1643e4dc93d267bde1a1c5cd2ef6b84806ce6728d1b062bf76d4c577
- Sigstore transparency entry: 145789340
- Sigstore integration time:
- Predicate type: