Skip to main content
https://travis-ci.org/anthon-alindada/django_api_view.svg?branch=master https://codecov.io/gh/anthon-alindada/django_api_view/branch/master/graph/badge.svg

Django basic api view and api response.

Documentation

The full documentation is at https://django_api_view.readthedocs.io.

Quickstart

Install Django api view. In the command line:

pip install django_api_view

Configuration

Add ‘django_api_view’ it to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'django_api_view',
    ...
)

Simple usage

Read full documentation for full features https://django_api_view.readthedocs.io.

Api View

ApiView will automatically parse post data.

It accepts 'application/json', 'application/x-www-form-urlencoded', or 'multipart/form-data'

For example:

from django_api_view.api_view import ApiView

class BasicApiView(ApiView):

    def get(self, request):
        # For get method use 'GET' to get parameters
        email = request.GET.get('email')

    def post(self, request):
        # For post method use 'data' to get parameters
        email = request.data.get('email')

Api Response

Api response retuns json response.

Basic example:

from django_api_view.api_response import ApiResponse

def get(request):
    # 'data' parameter is optional
    return ApiResponse().success(data={})

Version 0.1 (2017-07-25)

  • Initial release.

Release files for django-api-view 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-api-view 0.1.1
File Size Uploaded
django_api_view-0.1.1.tar.gz 5.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-api-view 0.1.1
File Interpreter ABI Platform
django_api_view-0.1.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 12.8 kB

Release files / django_api_view-0.1.1.tar.gz

Download URL django_api_view-0.1.1.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
cf1324212df6731e998c39d446a46e063226c0c3c4d3e118ff54f90ae5e61b2f
BLAKE2b-256 checksum
How to use checksums
86bc46da74f4cc2a6acbec38c97a027589d0cb521c35a43779544308278e5abd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_api_view-0.1.1-py2.py3-none-any.whl

Download URL django_api_view-0.1.1-py2.py3-none-any.whl
Size 7.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
4e830fe128f2bcd37b96692185fff21230e3295fb59887a98124e447f5f4e3f8
BLAKE2b-256 checksum
How to use checksums
c29e0e9998ea0f0f8301bfc39075ad88399972460ba423d9c9d5109a89e48bf5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page