Skip to main content

A Django date widget optimised for usability in entering dates of birth

Project description


Build Status

A Django date widget optimised for usability in entering dates of birth.

This is based on the guidelines put forward by the UK Government Digital Service at


from django import forms
from dobwidget import DateOfBirthWidget

class PersonModelForm(forms.ModelForm):
    Model form for people.

    class Meta(object):
        model = Person
        fields = ['name', 'date_of_birth']
        widgets = {
            'date_of_birth': DateOfBirthWidget(),

The DateOfBirthWidget can take an optional order parameter, to make it useful in non-UK jurisdictions:

    class Meta(object):
        model = Person
        fields = ['name', 'date_of_birth']
        widgets = {
            'date_of_birth': DateOfBirthWidget(order='MDY'),



  • Add support for Django 1.10


  • Handle far future dates that raise OverflowError when given to


  • Do not clear inputs if an invalid date is entered


  • Bug fix around character-based input


  • Allow attrs of the individual subwidgets to be set using day_attrs, month_attrs and year_attrs.


  • Initial release


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-dob-widget, version 1.2.0
Filename, size File type Python version Upload date Hashes
Filename, size django_dob_widget-1.2.0-py2.py3-none-any.whl (3.9 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size django-dob-widget-1.2.0.tar.gz (3.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page