Skip to main content

django-birthday

https://badge.fury.io/py/django-birthday.svg https://img.shields.io/pypi/pyversions/django-birthday.svg https://img.shields.io/pypi/djversions/django-birthday.svg https://github.com/bashu/django-birthday/actions/workflows/test.yml/badge.svg

django-birthday is a helper library to work with birthdays in models.

Maintained by Basil Shubin, and some great contributors.

Installation

First install the module, preferably in a virtual environment. It can be installed from PyPI:

pip install django-birthday

Usage

django-birthday provides a birthday.fields.BirthdayField model field type which is a subclass of django.db.models.DateField and thus has the same characteristics as that. It also internally adds a second field to your model holding the day of the year for that birthday, this is used for the extra functionality exposed by birthday.managers.BirthdayManager which you should use as the manager on your model.

A model could look like this:

from django.db import models
from django.conf import settings

from birthday import BirthdayField, BirthdayManager


class UserProfile(models.Model):
    user = models.ForeignKey(settings.AUTH_USER_MODEL)
    birthday = BirthdayField()

    objects = BirthdayManager()

Get all user profiles within the next 30 days:

UserProfile.objects.get_upcoming_birthdays()

Get all user profiles which have their birthday today:

UserProfile.objects.get_birthdays()

Or order the user profiles according to their birthday:

UserProfile.objects.order_by_birthday()

For more details, see the documentation at Read The Docs.

Contributing

If you like this module, forked it, or would like to improve it, please let us know! Pull requests are welcome too. :-)

Credits

django-birthday was originally started by Jonas Obrist who has now unfortunately abandoned the project.

License

django-birthday is released under the BSD license.

Changes

0.3.0 (2026-10-10)

  • Dropped support for Python < 3.11; 3.11 is now the minimum required version.

0.2.0 (2026-08-14)

  • Dropped support for Python < 3.10 and Django < 5.2; migrated packaging from setup.py/setup.cfg to pyproject.toml.

  • Added an automatic post_migrate handler that backfills the cached day-of-year column for pre-existing rows and rows written via bulk_create()/update() whose value was never computed, so BirthdayManager queries are correct without manual intervention (#5).

  • Fixed the cached day-of-year column being computed from each date’s own actual year, which made it inconsistent for the same calendar day across leap and non-leap years and caused BirthdayManager to silently miss or misorder matching birthdays (#8). Day-of-year is now always computed relative to a fixed reference year, independent of leap status.

Metadata

Release files for django-birthday 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-birthday 0.3.0
File Size Uploaded
django_birthday-0.3.0.tar.gz 8.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-birthday 0.3.0
File Interpreter ABI Platform
django_birthday-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.7 kB

Release files / django_birthday-0.3.0.tar.gz

Download URL django_birthday-0.3.0.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e27dd9ddd161667a796be35c96c396580055ea9723012deaa0400679917f6b8e
BLAKE2b-256 checksum
How to use checksums
a43756a2e46d541eeb52215f44a50071413df2be1982e7deb1264ebeb2c2990d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / django_birthday-0.3.0-py3-none-any.whl

Download URL django_birthday-0.3.0-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed72d9b3b9e375bfdcd352817d3bddc7ee751ee288687f9f045cdad0ccbbe7c8
BLAKE2b-256 checksum
How to use checksums
1d6e0f136bd3d1727cf63857317ef6d70141f865e8f12520cba958ac469d6a7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page