Skip to main content

Build production-ready Django REST APIs faster with less boilerplate.

Project description

Django Mindoff

Build production-ready Django REST APIs faster with less boilerplate.

Django Mindoff is an architectural framework that manages the structure and mechanics of API development so developers can focus on business logic, with efficient data workflows powered by Polars.

Coverage Status PyPI version Python

Documentation: https://django.mindoff.work

Source: https://github.com/mindoffwork/django-mindoff

Key Features

  1. Project Setup That Just Works
    Start a new API project with guided CLI commands for init, create, delete, and nuke. Projects start ready to run with a sensible structure, so developers can begin building APIs immediately without worrying about project layout.

  2. Fully Managed APIs
    Define request method, access control, payload rules, rate limits, and execution mode in a single API definition. Mindoff enforces these rules automatically, handling validation, security checks, and execution flow behind the scenes.

  3. API Versioning That Stays Manageable
    Ship and evolve versioned APIs using a built‑in routing structure. APIs are automatically organized so new versions stay clean while existing clients continue working without disruption.

  4. Queue-Ready APIs
    Run APIs synchronously or as background processes when needed. Simply switch process_mode to "queue" and Mindoff handles queue orchestration, status tracking, progress updates, cancellation, and retries.

  5. Validation in One Line
    Use simple validation helpers that keep API logic clean and cognitively light. With aggregation support, multiple validation errors can be captured together and returned in a structured response.

  6. Consistent Responses, Every Time
    Return responses through a unified response structure using response endpoints. Messages stay professional, consistent, and predictable across the entire API surface.

  7. Vectorized Model Validation & Bulk Writes
    Pass a model_frame (DataFrame or LazyFrame) to create or update and Mindoff validates it automatically against the Django model. Validation runs in a vectorized, loop‑free pipeline and valid rows are written directly to the model's table with high efficiency.

  8. Querysets to DataFrames, Instantly
    Provide a Django queryset and Mindoff converts the results into a DataFrame or LazyFrame. Data is returned with built‑in pagination and streaming support, making large reads predictable and efficient.

  9. Optimized Polars Utilities for DataFrame & LazyFrame
    Run checks, conversions, and transformations seamlessly across both DataFrame and LazyFrame with Mindoff’s Polars utilities. Operations run natively in vectorized form and stay tuned for performance and efficiency, keeping data pipelines smooth and predictable.

  10. Tests With Almost No Setup
    Write API tests using declarative test mixins that talk to the API automatically. Focus on verifying behavior instead of crafting request calls and basic assertions, which are handled automatically by Mindoff.

Quick Start

1. Install the Package

pip install django-mindoff

2. Initialize a Project

django-mindoff init

This sets up the project foundation for you, including structure, config files, and ready-to-run wiring. Framework dependencies are managed internally, and django-mindoff aligns compatible Django, DRF, and Polars versions for you. Read the complete list here: requirements guide.

What you should see:

  • A new project scaffold with manage.py, mindoff.py, config/, and apps/
  • Environment and config files ready to use

3. Create an App

python mindoff.py create

In the interactive flow, choose option 1 and create an app named shop.

What you should see:

  • App folder at apps/shop/
  • App route linked as versioned URL at config/urls.py
  • App path added INSTALLED_APPS at config/settings.py

4. Create an API

python mindoff.py create

In the interactive flow, choose option 2 and create an API named ping under the shop app.

This generates the API file and wires its route so the endpoint is callable right away.

What you should see:

  • API file at apps/shop/apis/ping.py
  • URL route auto-registered at apps/shop/urls.py

5. Return a Success Response

Open apps/shop/apis/ping.py and add this inside the API class run() method:

def run(self, request, *args, **kwargs):
    return mo_response_kit.json_response(
        code="SUCCESS",
        category="success",
        data={"message": "Hello from shop ping"}
    )

6. Run and Verify

Before running, start your virtual environment:

For Windows:

.venv\Scripts\Activate.ps1

For Mac/Linux:

source .venv/bin/activate

Run the Migrations:

python manage.py makemigrations
python manage.py migrate

Run the Local Server:

python manage.py runserver

Open:

  • http://127.0.0.1:8000/v1/shop/ping/

What you should get:

  • A JSON response with status, structured message metadata, and your data.message

✅ You now have a working API endpoint running with a structured success response.

From here, shape the run() method around your real business logic and output. To control response messaging, add custom entries in config/responses.csv with your preferred http_status code.

When you are ready to move beyond Quick Start, continue with the developer guide. It covers the package features in detail, explains configuration and architecture choices, and helps you build real-world applications with confidence.

License

This project uses the same BSD 3-Clause License as the Django project. See the LICENSE file for full terms.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_mindoff-0.4.0.tar.gz (102.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_mindoff-0.4.0-py3-none-any.whl (120.1 kB view details)

Uploaded Python 3

File details

Details for the file django_mindoff-0.4.0.tar.gz.

File metadata

  • Download URL: django_mindoff-0.4.0.tar.gz
  • Upload date:
  • Size: 102.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_mindoff-0.4.0.tar.gz
Algorithm Hash digest
SHA256 0d337c78fc9453b0f96395bbcc3c482a6b457f3d1127ce7e2ff53ebf0d26003b
MD5 d409232d8fe6188819b628a8d9b79239
BLAKE2b-256 39e0ae40925d02ac0a11c02baecf175f3c35f74d514adf49a2b19f9b1710ebd4

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_mindoff-0.4.0.tar.gz:

Publisher: cd.yml on mindoffwork/django-mindoff

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_mindoff-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: django_mindoff-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 120.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_mindoff-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 291a1b5f00fc58150ee71baa474d5f26fec24d089a77da5f8b0a27f1e278c096
MD5 1f48527fb2eaa04ff2f516faff6cac47
BLAKE2b-256 9e6360e00b9d1dd1e53ca53ed38d2621987bf0c1849c2efb4d3890ecabc6b687

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_mindoff-0.4.0-py3-none-any.whl:

Publisher: cd.yml on mindoffwork/django-mindoff

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page