djazzkit Django Package
Django adapter for djazzkit sync/query/rpc functionality.
Conflict Resolution v2
Conflict handling is opt-in per model and preserves current LWW behavior by default.
Configure per model
from djazzkit.models import SyncModel
from djazzkit.sync_meta import SyncScope, ConflictMode
class Note(SyncModel):
# ... fields ...
class SyncMeta:
scope = SyncScope.USER
owner_field = "author"
conflict_mode = ConflictMode.REVISION_TREE
Optional server-side resolver hook
def note_conflict_resolver(ctx: dict) -> dict | None:
# Return resolved data to auto-resolve, or None to keep conflict unresolved.
return None
class Note(SyncModel):
class SyncMeta:
scope = SyncScope.USER
owner_field = "author"
conflict_mode = ConflictMode.REVISION_TREE
conflict_resolver = staticmethod(note_conflict_resolver)
Surface unresolved conflicts
conflicted_notes = Note.objects.with_conflicts()
TypeScript side
Generated model classes provide:
Model.getConflicts(instanceId)Model.resolveConflict(instanceId, resolvedData)Model.conflict(row)._conflictsModel.conflict(row).resolveConflict(...)
Rows continue to serve the deterministic winner by default while losing revisions remain retained until explicitly resolved.
Remote query safety bounds
Remote query AST validation enforces server-side maxima for pagination inputs:
DJAZZKIT_QUERY_MAX_LIMIT(default:1000)DJAZZKIT_QUERY_MAX_OFFSET(default:10000)
Requests above these bounds are rejected with explicit validation codes:
limit_out_of_rangeoffset_out_of_range
Example settings:
DJAZZKIT_QUERY_MAX_LIMIT = 500
DJAZZKIT_QUERY_MAX_OFFSET = 5000
WebSocket auth and origin hardening
WebSocket auth/origin behavior is configurable:
DJAZZKIT_WS_ALLOW_ANONYMOUS_FALLBACK(default:True)- When
False, missing/invalid auth rejects the socket instead of downgrading to anonymous.
- When
DJAZZKIT_WS_REQUIRE_ORIGIN(default:False)- When
True, sockets without anOriginheader are rejected.
- When
Recommended production settings:
DJAZZKIT_WS_ALLOW_ANONYMOUS_FALLBACK = False
DJAZZKIT_WS_REQUIRE_ORIGIN = True
For trusted non-browser clients that cannot send Origin, keep
DJAZZKIT_WS_REQUIRE_ORIGIN = False and enforce transport-level trust.
Schema mismatch signaling
djazzkit now signals schema incompatibility over the sync websocket:
- Client sends
schema_versioninsync_start(via@djazzkit/coreSyncClientOptions.schemaVersion) - Server compares it to the current runtime schema hash
- On mismatch, server responds with:
{"type":"schema_mismatch","client_schema_version":"...","server_schema_version":"...","message":"..."}
@djazzkit/core exposes onSchemaMismatch so apps can choose their policy:
- reset local SQLite and resync
- run custom migration logic to preserve local data
- prompt user before taking action
Migration note
If internal djazzkit tables were previously created through --run-syncdb, run:
python manage.py migrate djazzkit --fake-initial
when adopting migration-managed internal tables.
Metadata
Release files for djazzkit 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| djazzkit-0.0.1.tar.gz | 71.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| djazzkit-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 123.3 kB
Release files / djazzkit-0.0.1.tar.gz
| Download URL | djazzkit-0.0.1.tar.gz |
|---|---|
| Size | 71.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
49c99d97008df2e1a60c6de00f741245b4c62831fb70480174e445cf9a58cf67
|
|
BLAKE2b-256 checksum How to use checksums |
d109112aa4d179ff53284693e9a3b2ccdc54c2798bede0a3f03da2669114dbbc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / djazzkit-0.0.1-py3-none-any.whl
| Download URL | djazzkit-0.0.1-py3-none-any.whl |
|---|---|
| Size | 52.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
48450b43e2967e44921994eee5fcee794cd62955a18476e5bc63fc2ad289aea0
|
|
BLAKE2b-256 checksum How to use checksums |
31f9051aeebca8a475e2c22658c605dfd6ff2b8de5bd4aba15a2e75602891d56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|