restframeworkmethods

Modules to REST API


Keywords
django
License
BSD-3-Clause
Install
pip install restframeworkmethods==0.2

Documentation

REST Framework Methods

This module is for implement an API (Django REST Framework) from Python module.

Features: * Generate a readonly REST API. * Add documentation through OPTIONS request. * Handle for args and kwargs. * Traceback for bad requests.

Install

#!bash
$ pip install restframeworkmethods

Usage

This example is in test directory, ready for run locally!

We want create an API for this module, so we need create a new app and in view just put:

from restframeworkmethods.rest_methods import ModuleViewSet
from .foo_mudule import CustomClassOrModule

########################################################################
class ExampleApiModuleView(ModuleViewSet):
    """"""
    module_class = CustomClassOrModule

and in urls.py

from django.conf.urls import url
from restframeworkmethods.rest_methods import get_APIRoot

from .views import ExampleApiModuleView

urlpatterns = [

    url(r"", ExampleApiModuleView.include(namespace="APItest")),

    ]

NO more!

Our API is ready!

1.png 2.png 3.png