Giter Site home page Giter Site logo

django-rest-fast's Introduction

Django REST Fast

Fast create REST API with Swagger documentation based on native django views and forms.

Features:

  • Maximum native integration with django, it is enough to decorate the view.
  • Form and ModelForm automatically parsed and added parameters into the swagger.
  • Parameters in urlpatterns automatically parsed as path parameters and added to swagger.

Documentation

Installation

pip install django-rest-fast
INSTALLED_APPS = [
    ...
    'django_rest_fast',
]

Add the following to your root urls.py file.

urlpatterns = [
    ...
    path('docs/', include('django_rest_fast.urls'))
]

Getting Started

# forms.py
from django import forms

class UserLoginForm(forms.Form):
    email = forms.EmailField()
    password = forms.CharField(min_length=8, max_length=20)


# views.py
from django_rest_fast.decorators import post

@post(form=UserLoginForm, tags=['users'])
def users_login_view(request):
    """User login"""
    pass

More examples you can see in the demo application.

Configuration

The default is the following configuration from django_rest_fast.conf:

DJANGO_REST_FAST = {
    'info': {
        'version': '0.0.1',
        'title': 'Django REST Fast',
        'description': '',
    },
}

It's possible to override it in the settings.py. Configs will be merged.

DJANGO_REST_FAST = {
    'info': {
        'version': '1.0.1',
    },
}

Demo

Run demo:

alt text

django-rest-fast's People

Contributors

qvp avatar

Watchers

 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.