Skip to main content

Generate DRF Serializers, Views, Apis, Unit tests for your application.

Project description

DRF Application Generators

Generate DRF standard apps with a single command.


Install with pip

$ pip install drf-app-generators

To use DRF app generators, add it to INSTALLED_APPS.



Generate a new Django app.

To use the generators, run the following command.

$ python 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 generate books --models Book,Author,Label
    ├── migrations
    │   ├──
    │   └──
    └── tests

Update an existing Django app.

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

$ python 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 app_update books \
    --factory \
    --admin \
    --api \
    --serializer \
    --unittest \
    --filter \
    --add-models Label,Category


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


MIT License. See LICENSE.

Project details

Download files

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

Files for drf-app-generators, version 0.1.4
Filename, size File type Python version Upload date Hashes
Filename, size drf-app-generators-0.1.4.tar.gz (16.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page