django-fernet-fields-v2
Fernet-encrypted model fields for Django
What it is and what it does
django-fernet-fields-v2 is a Django app that adds encrypted model fields using Fernet symmetric encryption from the cryptography library. It lets you mark sensitive fields for automatic encryption at rest in the database, so plaintext never touches disk. The package wraps Django's BinaryField and handles encryption and decryption transparently on read and write.
It is a fork updated to support Django 4. The package is tested against PostgreSQL, SQLite, and MySQL, though any Django backend supporting BinaryField should work. It requires Django >=3.2 and Python >=3.8, but has not been maintained since August 2023.
Use it for:
- Encrypt user passwords, API keys, or authentication tokens in a Django model without application-level encryption logic.
- Store personally identifiable information encrypted at rest in PostgreSQL, SQLite, or MySQL databases.
- Add field-level encryption to an existing Django project with minimal code changes.
- Comply with data protection regulations by encrypting sensitive fields before they reach the database.
- Protect against database breaches by ensuring stolen backups contain only ciphertext, not plaintext secrets.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides Fernet symmetric encryption for Django model fields, allowing you to encrypt sensitive data at the database level using the cryptography library.
Yes, if you need field-level encryption in Django and accept the maintenance risk. The package is abandoned (last update August 2023), so it will not receive security patches or compatibility fixes for newer Django or Python versions. Install only if your Django and Python versions are locked to those it was tested on, or if you are willing to fork and maintain it yourself.
Install
django-fernet-fields-v2 on PyPI
pip
pip install django-fernet-fields-v2uv
uv add django-fernet-fields-v2poetry
poetry add django-fernet-fields-v2Installing django-fernet-fields-v2
Before you install
Low friction install with only Django and cryptography as runtime dependencies. However, the package is abandoned—last release was 2023-08-15 and no commits since then. Use only if you accept that security or compatibility updates will not arrive.
License in practice
Licensed under MIT (permissive), so you can use, modify, and distribute freely with minimal restrictions.
Quickstart
pip install django-fernet-fields-v2
from django_fernet_fields_v2 import EncryptedTextField
class MyModel(models.Model):
secret = EncryptedTextField()
Requires Django >=3.2 and Python >=3.8; only PostgreSQL, SQLite, and MySQL are tested.
Verify before relying
- Whether the package works with Django versions released after 2023-08-15.
- Current compatibility with Python versions beyond 3.11.
- Whether cryptography library updates since last release affect encryption/decryption.
- Whether any Django database backends other than PostgreSQL, SQLite, and MySQL work with BinaryField support.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — Django, cryptography |
| Maintenance | abandoned — 1,095 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 974,985/month — #4,599 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: django_fernet_fields_v2-0.9-py3-none-any.whl
Tags
More Cryptography packages
Certifi provides Mozilla's curated collection…
copyleft · top 100 on PyPI
cryptographycryptography provides cryptographic recipes and…
permissive · top 100 on PyPI
rsaPure-Python RSA encryption, decryption,…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
azure-identityProvides Microsoft Entra ID token-based…
unclear · top 1,000 on PyPI
PyNaClPyNaCl provides Python bindings to libsodium…
permissive · top 1,000 on PyPI
django-fernet-encrypted-fieldsProvides Django model fields that encrypt data…
unclear · top 15,000 on PyPI
django-sequencesProvides gapless sequence generation for Django…
permissive · top 15,000 on PyPI
djfernetProvides Fernet symmetric encryption for Django…
permissive · top 15,000 on PyPI
fernetA pure Python implementation of the Fernet…
permissive · top 15,000 on PyPI
django-cryptography-5Provides encrypted model fields and…
permissive · top 15,000 on PyPI
django-cryptography-django5Encrypts and decrypts data in Django models…
permissive · top 15,000 on PyPI
django-cryptographyWraps Python's cryptography library to add…
permissive · top 15,000 on PyPI
django-encrypted-model-fieldsWraps Django model fields with transparent…
permissive · top 15,000 on PyPI
sqlcipher3-wheelsProvides a Python DB-API 2.0 interface to…
permissive · top 15,000 on PyPI