Skip to main content
Change of provenance

The repository or configuration that created this release differ from a previous release. View details.

Genkit Django Plugin

genkit-django exposes Genkit flows as HTTP endpoints in a Django application. It mirrors genkit-flask and genkit-fastapi: one decorator turns a @ai.flow into a Django view that speaks the Genkit HTTP protocol (JSON envelope, optional SSE streaming, structured error responses).

Building with a coding agent? Install the Genkit Python skill first.

npx skills add genkit-ai/skills --skill developing-genkit-python

It teaches your agent the current Genkit Python APIs and common gotchas. Source, manual install and skills for other languages: genkit-ai/skills.

Install

uv add genkit-django genkit-google-genai

Usage

# myapp/views.py
from genkit import Genkit
from genkit_django import genkit_django_handler
from genkit_google_genai import GoogleAI

ai = Genkit(plugins=[GoogleAI()], model=GoogleAI.gemini('gemini-flash-latest'))


@genkit_django_handler(ai)
@ai.flow
async def chat(prompt: str) -> str:
    response = await ai.generate(prompt=prompt)
    return response.text
# myproject/urls.py
from django.urls import path
from myapp.views import chat

urlpatterns = [
    path('chat/', chat),
]

The view requires Django's ASGI server (Django 5.0+):

uvicorn myproject.asgi:application

Wire protocol

  • Body: {"data": <flow_input>}. Missing data → 400.
  • Streaming: Accept: text/event-stream or ?stream=true. Each chunk emits data: {"message": ...}\n\n; completion emits data: {"result": ...}\n\n; on exception data: {"error": ...}.
  • Non-stream: {"result": <flow_output>} on success. A PublicError keeps its HTTP status and message; any other GenkitError (including a provider-marked failure) is 500 Internal Error.

Context provider

from genkit import FlowContext
from genkit.web import RequestData


async def auth(request_data: RequestData) -> dict[str, object]:
    return {'username': request_data.headers.get('authorization')}


@genkit_django_handler(ai, context_provider=auth)
@ai.flow
async def chat(prompt: str, ctx: FlowContext) -> str:
    user = ctx.context.get('username')  # what auth returned
    response = await ai.generate(prompt=prompt)
    return response.text

Metadata

Release files for genkit-django 0.14.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Change of provenance

The repository or configuration that created these release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Source distribution (sdist)

Source distribution for genkit-django 0.14.0
File Size Uploaded Provenance Actions
genkit_django-0.14.0.tar.gz 15.2 kB With provenance Details for genkit_django-0.14.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for genkit-django 0.14.0
File Interpreter ABI Platform Actions
genkit_django-0.14.0-py3-none-any.whl Python 3 none any Details for genkit_django-0.14.0-py3-none-any.whl

Total release size: 26.4 kB

Release files / genkit_django-0.14.0.tar.gz

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL genkit_django-0.14.0.tar.gz
Size 15.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3e20d510903fd71880adbb4b07ca02e672e8671f77cf0e76e5e1c8c29b0c5fd8
BLAKE2b-256 checksum
How to use checksums
042866a6a4b97b3e15fa7cdc15d50baaf1f5c820f12ad8b0b41b064ee33619fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / genkit_django-0.14.0-py3-none-any.whl

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL genkit_django-0.14.0-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9170bfdc6382983cd33a003581b9043fc5a4255e12b0ebccbca5ff7d28945f3c
BLAKE2b-256 checksum
How to use checksums
1ad161646ed92206226cbc234f6de7cfd3fbee110fc13b0c7e96e53879687515
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Security for genkit-django 0.14.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Change of provenance

The repository and configuration that created this release differ from a previous release.

While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.

Select from 2 files

Attestation for genkit_django-0.14.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page