Your Django models,
served as REST APIs.
Say which fields each operation reads and writes. django-ninja-aio-crud builds the async Django Ninja endpoints, validation and OpenAPI schema for you.
- Version {{ config.extra.nac_version }}
- Fully async
- MIT license
from django.db import models
from ninja_aio.models import ModelSerializer
class Article(ModelSerializer):
title = models.CharField(max_length=200)
body = models.TextField()
class ReadSerializer:
fields = ["id", "title", "body"]
class CreateSerializer:
fields = ["title", "body"]
class UpdateSerializer:
optionals = [("title", str), ("body", str)]
@@API_CODE@@
Generated endpoints
{% include "partials/route_examples.html" %}How it works
Three steps from model to API
-
1
Describe the fields
Inner serializer classes list what each operation reads and writes.
-
2
Register a viewset
@@REGISTER_TEXT@@
-
3
Ship the endpoints
Five validated async routes and an OpenAPI schema.
Features
What's in {{ config.extra.nac_version }}
Start with a few lines. Add the rest when you need it.
Where to go next
Pick your path
Build your first endpoint now
Install the package and follow the docs for {{ config.extra.nac_version }}.