Introduction

Overview of Django Ninja CRUD

Django Ninja CRUD introduces modularity to API development with Django Ninja, revolutionizing how APIs are built and maintained at scale while avoiding repetition. It empowers developers to create reusable, composable API views ranging from built-in CRUD (Create, Read, Update, Delete) operations to complex custom endpoints, supporting both sync and async implementations, all with minimal boilerplate code.

🌞 Key Features

  • Modular Views: Easily extend APIView to create reusable components for repeated business logic. Define views by stating intent, with unrestricted function signatures supporting both sync and async implementations.

  • Flexible Built-in CRUD Views: Pre-built, customizable ListView, CreateView, ReadView, UpdateView, and DeleteView views. Use as-is, customize, or use as blueprints for your own implementations. Supports any path parameters, pagination, filtering, decorators, and more.

  • Powerful Viewset Composition: Use views independently or compose them into APIViewSet for grouped, related views sharing attributes. Design versatile APIs supporting multiple instances of the same view typeβ€”perfect for API versioning, or alternative representations.

  • Seamless Django Ninja Integration: Enhance your existing Django Ninja project without changing its structure. Gradually adopt declarative views to clean up your codebase and boost development efficiency.

Django Ninja CRUD Code

[!NOTE]
As shared in my DjangoCON Europe 2024 talk,
Django Ninja CRUD emerged from countless hours of wrestling with repetitive, complex
and hard-to-maintain APIs. My vision is to address those common pain points by
providing a declarative and modular approach, making API development not just more
efficient, but truly intuitive and enjoyable. I hope it revolutionizes your
development experience as it has mine.

πŸ“ Requirements

Python versions
Django versions
Django Ninja versions

βš’οΈ Installation

pip install django-ninja-crud

πŸ’¬ What's Next?

  • Quick Examples: The section contains easy-to-understand examples of how to use the package and test its features. This will provide you with a practical understanding of how the package works.
  • Detailed Documentation: For a more comprehensive understanding of Django Ninja CRUD, navigate to our detailed documentation. Here, you'll find in-depth explanations of the package's features and capabilities, as well as advanced usage examples.
  • Community: Join our community for discussions, support, and updates related to Django Ninja CRUD. Share your experiences, learn from others, and contribute to improving the package.