Skip to main content

CLI for Django and SaaS Pegasus

Project description

cli

PyPI Changelog Tests License

Demo

A demo is worth 1,000 words. Click the image below to see the Pegasus CLI in action:

Pegasus CLI Demo

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

The above configuration is the recommended configuration for SaaS Pegasus projects, and will be included in your project's pegasus-config.yaml file if you are on Pegasus version 2024.9 or later.

It 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


Download files

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

Source Distribution

pegasus_cli-0.3.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

pegasus_cli-0.3-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

Details for the file pegasus_cli-0.3.tar.gz.

File metadata

  • Download URL: pegasus_cli-0.3.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for pegasus_cli-0.3.tar.gz
Algorithm Hash digest
SHA256 94593c03363f3a08318b92af229e22d31e9e71a293b45fc4dc58153484f26dcf
MD5 42e1d22560524d2adb9f959c15358829
BLAKE2b-256 9953721010b925187cd0043a32c922a678d65147bba067d0c3ef13fc726fbb1e

See more details on using hashes here.

File details

Details for the file pegasus_cli-0.3-py3-none-any.whl.

File metadata

  • Download URL: pegasus_cli-0.3-py3-none-any.whl
  • Upload date:
  • Size: 20.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for pegasus_cli-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8a4502e76d22508df11a3b4d2e699be9b61f16a9b735c9eb0a87dd7587f50450
MD5 c1b8d6f2fe4bd363ba5ae45448657a48
BLAKE2b-256 199a354a2301275f5b3fabb3fcffcd62f38bfeadbea4e8a94cb3ea66dbecc76c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page