Skip to main content

DRF Application Generators

Generate DRF standard apps with a single command.

Installation

Install with pip

$ pip install drf-app-generators

To use DRF app generators, add it to INSTALLED_APPS.

INSTALLED_APPS = (
    ...
    'rest_framework',
    'drf_app_generators',
    ...
)

Usage

Generate a new Django app.

To use the generators, run the following command.

$ python manage.py generate {app} {options}
Options Description
--models A list of model names.
--apidoc Generate written API document
--nested Create nested folders for models, apis, factories and serializers
--force Override existed files

Example: Generate a new app with 3 models.

$ python manage.py generate books --models Book,Author,Label
    src/books/
    ├── __init__.py
    ├── admin.py
    ├── apis.py
    ├── apps.py
    ├── factories.py
    ├── filters.py
    ├── migrations
       ├── 0001_initial.py
       └── __init__.py
    ├── models.py
    ├── permissions.py
    ├── serializers.py
    └── tests
        ├── __init__.py
        ├── test_books_apis.py
        └── test_books_models.py

Update an existing Django app.

When you finished adding fields to your models, you can update factories & admins by the following commands.

$ python manage.py app_update {app} {options}
Options Description
--nested If you app is nested
--factory Update your factories.
--api Update your APIs.
--admin Update your admin.
--serializer Update your serializers.
--unittest Update your unittest.
--filter Update your filters.
--all Update all components.
--add-models Add more models to your app.

Example: Update books app we just generated.

python manage.py app_update books \
    --factory \
    --admin \
    --api \
    --serializer \
    --unittest \
    --filter \
    --add-models Label,Category

Tests

A full application built with drf-generators can be found in the tests directory.

License

MIT License. See LICENSE.

Release files for drf-app-generators 0.1.5

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-app-generators 0.1.5
File Size Uploaded
drf-app-generators-0.1.5.tar.gz 15.6 kB Details

Release files / drf-app-generators-0.1.5.tar.gz

Download URL drf-app-generators-0.1.5.tar.gz
Size 15.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1a5f1d2ea955506158236478d98cb6dcc796b52855d9fbf06ba56486fffd7e52
BLAKE2b-256 checksum
How to use checksums
a74f302bf9344a2eba9d3146717751bd682978224588c34f8a0f1f4a85f6449c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

Release history Release notifications | RSS feed

This release

0.1.5 This release

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

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