skillfed

django-citext

PostgreSQL CIText integration for Django.

django-citext v1.0.3 78.4K downloads/30d#14,446 on PyPI23
Permissive license Active released

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-citext

uv

uv add django-citext

poetry

poetry add django-citext

Installing 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

Development Status :: 1 - PlanningEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.1Framework :: Django :: 5.2Intended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: DatabaseTopic :: Software DevelopmentTopic :: Software Development :: Libraries :: Python Modules

Tags

django postgresql case insensitivecitext django fieldscase insensitive email djangopostgres citext integrationdjango case insensitive textpostgresql text search django
postgres-integrationdjango-orm

More Software Development packages

typing-extensions

Provides backported and experimental type hints…

permissive · top 100 on PyPI

numpy

NumPy provides an N-dimensional array object…

permissive · top 100 on PyPI

fastapi

FastAPI is a Python web framework for building…

permissive · top 100 on PyPI

annotated-doc

Provides a way to document function parameters,…

permissive · top 100 on PyPI

typer

Typer builds command-line applications from…

permissive · top 1,000 on PyPI

distlib

Distlib provides low-level packaging utilities…

permissive · top 1,000 on PyPI

django-postgres-extra

Extends Django's ORM to expose…

permissive · top 15,000 on PyPI

django-netfields

Provides Django model fields for PostgreSQL…

permissive · top 15,000 on PyPI

django-postgres-copy

Provides Django ORM integration for…

permissive · top 5,000 on PyPI

django-add-default-value

Provides a Django migration operation to set…

permissive · top 15,000 on PyPI

django-deprecate-fields

Provides a decorator to mark Django model…

permissive · top 5,000 on PyPI

sqlalchemy-searchable

Adds fulltext search capabilities to SQLAlchemy…

permissive · top 15,000 on PyPI

django-colorfield

Adds a color field to Django models with an…

permissive · top 5,000 on PyPI

django-pglocks

Provides PostgreSQL advisory locks for Django…

permissive · top 15,000 on PyPI

django-pg-returning

Extends Django's ORM to capture and return rows…

permissive · top 15,000 on PyPI

django-types

Provides type stubs for Django to enable static…

permissive · top 5,000 on PyPI