crudkit
A metadata-driven CRUD framework for Django. Define models; get typed object IDs, soft delete, merge, change logging, an activity feed, saved views, AI-populated fields and a generic REST API — without writing per-model serializers, viewsets or routes.
Core concepts
Every CrudKit model inherits BaseCrudKitModel and declares a 3-letter
TYPE_ID. Object IDs are rendered as <TYPE_ID><pk> (e.g. CUS42) across
the API and UI.
from django.db import models
from crudkit.models import BaseCrudKitModel
class Customer(BaseCrudKitModel):
TYPE_ID = "CUS"
name = models.CharField(max_length=255)
class CrudKitSettings(BaseCrudKitModel.CrudKitSettings):
search_fields = ["name"]
Included with every model: created_by/updated_by/created_at/updated_at
audit columns, a deleted soft-delete flag (soft_delete()), merge support
(delete_and_merge_with()), a change log, an activity feed (FeedItem),
external-system sync (ExternalObject), saved views/layouts, and optional AI
fields (AISummaryField, AICategoryField, AIBooleanField, AITagsField,
AIForeignKeyField) populated asynchronously via Celery and pydantic-ai.
Installation
pip install crudkit[api] # REST API included
pip install crudkit[assistant] # + per-object AI assistant (Channels)
INSTALLED_APPS = [
...,
"rest_framework",
"crudkit",
"crudkit_assistant", # optional
]
REST_FRAMEWORK = {
"DEFAULT_PAGINATION_CLASS": "crudkit_api.pagination.CrudKitPagination",
"DEFAULT_FILTER_BACKENDS": ["crudkit_api.filters.BasicFilter"],
"PAGE_SIZE": 50,
}
# urls.py — one include registers a full CRUD API for every TYPE_ID model
urlpatterns = [path("api/v1/", include("crudkit_api.urls"))]
Settings
| Setting | Purpose |
|---|---|
CRUDKIT_AI_MODEL |
pydantic-ai model string (e.g. "mistral:mistral-large-latest") enabling AI fields/assistant |
CRUDKIT_AI_MODEL_FACTORY |
dotted path to an async context manager yielding a pydantic-ai Model (advanced) |
CRUDKIT_USER_PROFILE_ADAPTER |
dotted path to a class supplying preferred language + avatar images for users |
CRUDKIT_EXTRA_GENERIC_RELATIONS |
project models surfaced as generic relations in object metadata |
CRUDKIT_DEFAULT_CURRENCY, CRUDKIT_CURRENCY_CHOICES |
currency configuration for MoneyField |
CRUDKIT_GRAVATAR_FALLBACK_EMAIL |
fallback avatar email (gravatar mp default otherwise) |
CRUDKIT_DASHBOARD_WIDGETS |
dotted path to a dashboard_for_user(user) widget provider |
CRUDKIT_ASSISTANT_NAME, CRUDKIT_ASSISTANT_SYSTEM_PROMPT, CRUDKIT_ASSISTANT_AVATAR_URL |
assistant branding |
CRUDKIT_FRONTEND_CONFIG |
dict injected into the bundled SPA at runtime (app_name, logo_url, ...) |
CRUDKIT_FRONTEND_LOGIN_REQUIRED |
redirect anonymous users of the SPA view to LOGIN_URL |
Bundled frontend
The wheel ships the built CrudKit web SPA. To serve it, add the app, the context processor, a config dict, and a catch-all url include (last!):
INSTALLED_APPS = [..., "crudkit_frontend"]
TEMPLATES = [{
...,
"OPTIONS": {"context_processors": [
...,
"crudkit_frontend.context_processors.crudkit_config",
]},
}]
CRUDKIT_FRONTEND_CONFIG = {"app_name": "My App"} # injected into the SPA at runtime
CRUDKIT_FRONTEND_LOGIN_REQUIRED = False # True → redirect anonymous users to LOGIN_URL
# urls.py — must be the LAST pattern; everything unmatched serves the SPA
urlpatterns = [..., path("", include("crudkit_frontend.urls"))]
Static assets are served by django.contrib.staticfiles (or WhiteNoise et
al.) from crudkit_frontend/static/. Contributors hacking on the SPA itself
run the Vite dev server from ../frontend against any CrudKit
backend; npm run build there regenerates the bundled assets.
Running the tests
cd backend
uv sync --all-extras
uv run manage.py test crudkit crudkit_api crudkit_assistant crudkit_frontend tests
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file crudkit-0.2.0.tar.gz.
File metadata
- Download URL: crudkit-0.2.0.tar.gz
- Upload date:
- Size: 601.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d3040e378c81957579e511ec7daeccd7fec71ca763439b95879cd6fe85643fc
|
|
| MD5 |
2631da12086915f2a6664f60130a37ab
|
|
| BLAKE2b-256 |
933c11ae568e702172d69d5aff40cf0b36676904b64fe3955d0d8d75c06a9105
|
Provenance
The following attestation bundles were made for crudkit-0.2.0.tar.gz:
Publisher:
publish-python.yml on fenerum/crudkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
crudkit-0.2.0.tar.gz -
Subject digest:
0d3040e378c81957579e511ec7daeccd7fec71ca763439b95879cd6fe85643fc - Sigstore transparency entry: 2426399657
- Sigstore integration time:
-
Permalink:
fenerum/crudkit@edba650760ce44f5b3aa0d60fa92e42733214bce -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/fenerum
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@edba650760ce44f5b3aa0d60fa92e42733214bce -
Trigger Event:
push
-
Statement type:
File details
Details for the file crudkit-0.2.0-py3-none-any.whl.
File metadata
- Download URL: crudkit-0.2.0-py3-none-any.whl
- Upload date:
- Size: 603.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87b547c3d5635309020e961269a26a988106c6c6681d4cb36d1c5f36bd5f7596
|
|
| MD5 |
927d7bc9a021a1c9217bf919aa82b907
|
|
| BLAKE2b-256 |
ddcb6e154b863a9fd25b444439ab4c9d7b6e92ab5d76bde888f5c23924a15e0b
|
Provenance
The following attestation bundles were made for crudkit-0.2.0-py3-none-any.whl:
Publisher:
publish-python.yml on fenerum/crudkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
crudkit-0.2.0-py3-none-any.whl -
Subject digest:
87b547c3d5635309020e961269a26a988106c6c6681d4cb36d1c5f36bd5f7596 - Sigstore transparency entry: 2426399765
- Sigstore integration time:
-
Permalink:
fenerum/crudkit@edba650760ce44f5b3aa0d60fa92e42733214bce -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/fenerum
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@edba650760ce44f5b3aa0d60fa92e42733214bce -
Trigger Event:
push
-
Statement type: