api package

The app that handles the API.

Submodules

api.response module

Convenience classes and functions for API responses.

api.response.require_methods_api(allowed_methods='GET', 'HEAD')[source]
Decorator to make an API view only accept particular request methods.
Based on django.views.decorators.http.require_http_request().
Parameters

allowed_methods (Tuple[str, …]) – The allowed request methods.

Return type

Callable

class api.response.JsonError(message, status=500, **kwargs)[source]

Bases: django.http.response.JsonResponse

A JSON-formatted error response.

Parameters
  • message (str) – The error message of the response.

  • status (int) – The HTTP status of the response.

api.urls module

The main URLconf of the api app.

api.urls.urlpatterns = [<URLPattern '' [name='root']>, <URLResolver <module 'api.v1.urls' from '/home/docs/checkouts/readthedocs.org/user_builds/mangadventure/envs/v0.6.6/lib/python3.7/site-packages/api/v1/urls.py'> (v1:v1) 'v1/'>]

The main URL patterns of the API app.