Skip to content

vericant/django-coreapi-client

Repository files navigation

Django CoreAPI client

Wrapper around coreapi.Client for convenient usage in Django projects.

Usage

Define settings:

COREAPI_CLIENT = {
    'example_server': {
        'SCHEMA_URL': 'https://example.com/api/schema/',
        'AUTH_USERNAME': 'client-example',
        'AUTH_PASSWORD': 'password-example',
    },
}

Initialize client:

from django_coreapi_client import Client

client = Client('example_server')

Access API endpoints according to the schema, e.g.

users = client.api.users.list()
project = client.api.users.projects.read(id=7)
new_project = client.api.users.projects.create(name='xxx', user_id=3)

Et cetera.

Hope it's useful. 73!

About

CoreAPI client wrapper for Django

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages