Skip to main content

DRF Compose

https://img.shields.io/pypi/v/drf_compose.svg https://img.shields.io/travis/IamAbbey/drf_compose.svg Documentation Status Updates

DRF Compose is a Python package for defining and quick starting Django Rest Framework projects. With DRF Compose, you use a JSON or YAML file to configure your DRF application. Then, with a single command, you get to generate your DRF project code using all the specified configuration from your compose file. To learn more about all the features of DRF Compose, see the list of features below.

DRF Compose is aimed at making the process of starting a DRF project quick and fun - giving you a development head start experience - while also preventing any frustration caused by the inability to quick start an API.

Installing

Install and update using pip:

$ pip install -U drf_compose

Usage

Using DRF Compose is basically a two-step process:

  • Define your application in a drf-compose.json file.

  • Run drf-compose and the DRF compose command generates a ready to use DRF project code.

Command options overview and help

You can also see this information by running drf-compose –help from the command line.

Usage: drf-compose [OPTIONS]

  This script composes a DRF project.

Options:
  -s, --source FILE  Specify an alternate compose file as source  [default: drf-compose.json]
  --yaml             Indicates that the supplied source file is a YAML file
  --help             Show this message and exit.

Options

  1. name (required): specifies the project name.

  2. app_with_model (required): specifies details describing each apps in the DRF project.

    • app_name (required): specifies the app name

    • models: a list of models belonging to the app

      • name (required): specifies the model name

      • meta: specifies the different model meta options as in the Django model meta documentation

      • fields (required): a list of fields belonging to a model.

      • use_uuid_as_key (boolean): if True, a UUID is used as the model’s primary key.

      • str: specifies the field to be returned as representation of the model in __str__. Must be one of the specified field names

  3. auth_app: specifies details of the authentication application.

    • app_name (required): specifies the app name

    • model_name (required): specifies the model name for the custom user model

    • username_field: A string describing the name of the field on the user model that is used as the unique identifier Django USERNAME_FIELD documentation.

    • email_field: A string describing the name of the email field on the User model. Django’s EMAIL_FIELD documentation

    • required_fields: A list of the field names that will be prompted for when creating a user via the createsuperuser management command Django’s REQUIRED_FIELDS documentation

    • meta: specifies the different model meta options as in the Django model meta documentation

    • fields: a list of fields belonging to a model.

    • use_uuid_as_key (boolean): if True, a UUID is used as the model’s primary key.

    • str: specifies the field to be returned as representation of the model in __str__. Must be one of the specified field names

  4. include: specifies the addons to be included in the application.

    • simple_jwt (boolean): if True, includes Simple JWT JSON Web Token authentication plugin into the application.

      COMING SOON!

    • django_filter (boolean) if True, includes Django-filter, a reusable Django application allowing users to declaratively add dynamic QuerySet filtering from URL parameters.

    • docker (boolean): if True, includes docker setup option into the application.

    • dj-database-url (boolean): if True, includes DJ-Database-URL , a simple Django utility allows you to utilize the 12factor inspired DATABASE_URL environment variable to configure your Django application.

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

Metadata

Release files for drf-compose 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for drf-compose 0.1.1
File Size Uploaded Provenance
drf_compose-0.1.1.tar.gz 25.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for drf-compose 0.1.1
File Interpreter ABI Platform
drf_compose-0.1.1-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 45.7 kB

Release files / drf_compose-0.1.1.tar.gz

Download URL drf_compose-0.1.1.tar.gz
Size 25.0 kB
Tags Source
SHA-256 checksum
How to use checksums
37d940442468a0d43dd8c181d482b48688afa48997d5b53da208d3b9432a6132
BLAKE2b-256 checksum
How to use checksums
f5ef2216d335dc0b98c86eb31cbe0a19bbb700020059f55a1bcc64ed905ff0bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

Release files / drf_compose-0.1.1-py2.py3-none-any.whl

Download URL drf_compose-0.1.1-py2.py3-none-any.whl
Size 20.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
90ccd55a23220f959165ccf7abdbf9598aa3d981d93b10136c1a772e730f2089
BLAKE2b-256 checksum
How to use checksums
e99a1f2d39143be4163c791309ae696f015d80cfb392aea8407776d64e5e559d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

Security for drf-compose 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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