Skip to content

Introduction

Djapy is a library that allows you to create RESTful APIs within Django with no boilerplate, using plain Python and Pydantic. It is designed to be simple, easy to use, and fast.

Djapy is molded according to Django's philosophy of "batteries included", and is designed to be as simple as possible to use, while still being powerful enough to handle most use cases.

@djapify
def get_user(request) -> {200: UserSchema, 404: str}:
    return request.user

It's that simple!

Features

  • IO type checking: Pydantic-based, and swagger integrated
  • Easy to use: No boilerplate, just plain Python
  • Delicious Syntax: Simple and easy to understand
  • Fast: Built on top of Django, and Pydantic, and is designed to be fast
  • Extensible: Customizable, and can be used with any Django project
  • Pagination: CursorPagination, OffsetLimitPagination and PageNumber out of the box; with ability to create custom pagination
  • Error handling: Customizable error handling, and error messages; validation errors/messages can be customized
  • Django friendly: Based on Django's structure, architecture and
  • Auth: Built-in support for Django's authentication and authorization; with ability to create custom authentication and authorization

Installation

Djapy is available on PyPI, and can be installed with pip:

pip install djapy
or
pip install git+https://github.com/Bishwas-py/djapy.git@main # for the latest version

Creating a new project

To create a new project, run the following command:

django-admin startproject <project_name>

More on this in the usage section.