Git Product home page Git Product logo

django-handyhelpers's Introduction

django-handy-helpers

Author David Slusser
Description A collection of handy utilities to support django projects
Requirements Python 3.x
Django 2.2.x

Documentation

Full documentation can be found on http://django-handyhelpers.readthedocs.org. Documentation source files are available in the docs folder.

How to Install

The django-userextensions package is available on Python Package Index (PyPI) and can be installed via pip:

pip install django-handyhelpers

add 'handyhelpers' to your INSTALLED_APPS (for management commands and templates)

INSTALLED_APPS = [
    ...
    'handyhelpers',
]

Management Commands

DRF Generator

Django-handyhelpers includes manage.py commands to generate DRF files (api views, serializers, urls) for a given app in your project. This is done using jinja templates that define the structure of each file. Default templates are provided, and custom templates can be provided in the command. By default, all models and models fields are included.

Example command:

manage.py generate_drf <my_app> --serializer
manage.py generate_drf <my_app> --serializer --serializer_template <my_custom_template>

** use the --help parameter for a full list of options

manage.py generate_drf --help

Admin Generator

Included with django-handyhelpers are manage.py commands to auto-generate an admin.py file for a given application in your project. This is done using a jinja template that defines the structure of the admin.py file. A default template is provided.

Example command:

manage.py generate_admin <my_app>
manage.py generate_admin <my_app> --template <my_custom_template>

** use the --help parameter for a full list of options

manage.py generate-admin --help     

Mixins

FilterByQueryParamsMixin

Allows your list views to be filtered by query parameters.

InvalidLookupMixin

Returns an applicable error, instead of results based on an unfiltered queryset, if a provided lookup expression, filter, or model field is invalid.

django-handyhelpers's People

Contributors

davidslusser avatar dependabot[bot] 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.