API Reference¶
Scan¶
django_camera_kit.widgets.DocumentScannerWidget
¶
Bases: FileInput
FileInput enhanced with in-browser document scanning.
Detects document edges live (OpenCV.js WASM, fully client-side), lets the user drag the corners when auto-detection misses, and chains multiple pages into a single PDF before writing the result back into this input via the DataTransfer API. No server round-trip and no extra models are required — drop it into any existing FileField or ImageField and it behaves like a regular file input to the rest of the form.
KYC¶
django_camera_kit.kyc.widgets.KYCVerificationWidget
¶
Bases: HiddenInput
Hidden field populated with a KYCVerification id once the user completes the live capture + server-side verification flow.
Renders a "Vérifier mon identité" button next to the hidden input — unlike DocumentScannerWidget, there is deliberately no file-upload fallback: allowing a raw upload here would defeat the whole point of the liveness challenge (anyone could submit a stolen photo).
django_camera_kit.kyc.models.KYCVerification
¶
Bases: Model
django_camera_kit.kyc.views.KYCVerifyView
¶
Bases: APIView
Accepts a selfie and an ID document photo, extracts a face embedding from each server-side, and compares them. Matching only ever happens here — no client-supplied embedding or score is ever trusted.
Requires authentication: a verification is meaningless without knowing whose identity it claims to confirm, and the endpoint runs a full face- embedding inference pass per request, so it also needs to be rate limited (KYCVerifyThrottle) rather than open to anonymous callers.
django_camera_kit.kyc.throttling.KYCVerifyThrottle
¶
Bases: UserRateThrottle
Rate-limits KYCVerifyView per authenticated user.
Each request runs a full face-embedding inference pass — without a limit, the endpoint is a cheap resource-exhaustion and brute-force probing vector. Reads from DJANGO_CAMERA_KIT_KYC.THROTTLE_RATE (see conf.py) instead of DRF's global DEFAULT_THROTTLE_RATES, so this reusable app doesn't require the consuming project to configure DRF throttle scopes globally.