Giter VIP home page Giter VIP logo

drf-app-generators's Introduction

DRF Application Generators

Generate DRF standard apps with a single command.

Installation

Install with pip

$ pip install -e git+https://github.com/tranquochuy/drf-app-generators#egg=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 Tell the update service that your app is nested
--force Override existed files

Example: Update books app we just generated.

$ python manage.py app_update books --nested --force

Tests

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

License

MIT License. See LICENSE.

drf-app-generators's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.