django-citext
PostgreSQL CIText integration for Django.
What it is and what it does
Django-citext restores PostgreSQL's CIText field support to Django after it was removed in Django 5.0. It provides CITextField and CIEmailField that store text in PostgreSQL's case-insensitive citext type, making queries case-insensitive at the database level rather than in application code. The package is a thin wrapper around Django's model field API, requiring only django as a runtime dependency.
You add it to INSTALLED_APPS, then use CITextField or CIEmailField in your models just like standard Django fields. Queries automatically become case-insensitive—a lookup for 'user@example.com' will match 'USER@EXAMPLE.COM' in the database without extra application logic. This is useful when you need case-insensitive matching but want the database to handle it efficiently.
Use it for:
- Store user emails with case-insensitive uniqueness constraints to prevent duplicate accounts with different casing
- Build case-insensitive username or slug fields that match user input regardless of capitalization
- Query product names or tags without worrying about case variations in the stored data
- Migrate from Django's removed CIText implementation to a compatible replacement
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides PostgreSQL CIText field types for Django models, enabling case-insensitive text and email fields that delegate matching to the database.
Yes, if you use PostgreSQL and need case-insensitive text fields in Django. Low friction, active maintenance, permissive license, and no known vulnerabilities. The main constraint is PostgreSQL dependency—this only works with PostgreSQL databases, not SQLite or MySQL. Suitable for production use in Django 4.2+ projects.
Install
django-citext on PyPI
pip
pip install django-citextuv
uv add django-citextpoetry
poetry add django-citextInstalling django-citext
Before you install
Low install friction with a single django dependency. Actively maintained with recent commits and compatible with Django 4.2 through 5.2 and Python 3.9+.
License in practice
Permissive license means you can use, modify, and distribute this package with minimal restrictions in both open-source and commercial projects.
Quickstart
pip install django-citext
# settings.py
INSTALLED_APPS = [
"citext",
]
# models.py
from citext import CITextField, CIEmailField
class MyModel(models.Model):
name = CITextField()
email = CIEmailField(unique=True)
Requires PostgreSQL database; does not work with SQLite or MySQL.
Verify before relying
- Whether CITextField and CIEmailField support all Django field options beyond the basic usage shown
- Performance characteristics when querying large tables with case-insensitive lookups
- Compatibility with Django ORM features like Q objects and complex queries
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — django |
| Maintenance | actively maintained — 256 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 78,371/month — #14,446 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: django_citext-1.0.3-py3-none-any.whl
Keywords: PostgreSQL, Django, CITEXT, Case Insensitive, postgres
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
django-postgres-extraExtends Django's ORM to expose…
permissive · top 15,000 on PyPI
django-netfieldsProvides Django model fields for PostgreSQL…
permissive · top 15,000 on PyPI
django-postgres-copyProvides Django ORM integration for…
permissive · top 5,000 on PyPI
django-add-default-valueProvides a Django migration operation to set…
permissive · top 15,000 on PyPI
django-deprecate-fieldsProvides a decorator to mark Django model…
permissive · top 5,000 on PyPI
sqlalchemy-searchableAdds fulltext search capabilities to SQLAlchemy…
permissive · top 15,000 on PyPI
django-colorfieldAdds a color field to Django models with an…
permissive · top 5,000 on PyPI
django-pglocksProvides PostgreSQL advisory locks for Django…
permissive · top 15,000 on PyPI
django-pg-returningExtends Django's ORM to capture and return rows…
permissive · top 15,000 on PyPI
django-typesProvides type stubs for Django to enable static…
permissive · top 5,000 on PyPI