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.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.
Release files for django-birthday 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django_birthday-0.2.0.tar.gz | 11.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_birthday-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.2 kB
Release files / django_birthday-0.2.0.tar.gz
| Download URL | django_birthday-0.2.0.tar.gz |
|---|---|
| Size | 11.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b9467fe92a7b0aafde9dc1a9a98274d038151d1dfec846adc8367cdee28fcd48
|
|
BLAKE2b-256 checksum How to use checksums |
b7edb382a9204c59863be0434ca1a50ca135d717d2a73fb18334af2a719b5908
|
| 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 Aug 14, 2026.
Transparency logRelease files / django_birthday-0.2.0-py3-none-any.whl
| Download URL | django_birthday-0.2.0-py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5b77c312bef1a5004246a018eebfe9526cbb23a2da48ce060af5c8da67031c5c
|
|
BLAKE2b-256 checksum How to use checksums |
375d6303eba7d0421ac61db9f9af81d3b73c97751aaf08a6a2451240fa66ae7a
|
| 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 Aug 14, 2026.
Transparency log