Skip to content

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

License

Notifications You must be signed in to change notification settings

qvp/django-rest-fast

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published