django-flatpickr
This django widget contains Date-Picker, Time-Picker, DateTime-Picker input widgets with date-range-picker functionality for django version >= 2.0. The widget implements flatpickr to display date-pickers in django model forms and custom forms which can be configured easily for date-range selection. For Bootstrap date-picker see django-bootstrap-datepicker-plus.
Demo
- Custom Form.
- Model Form.
- Generic View (without Model Form).
- With django-crispy-forms.
- With django-filter.
- With dynamic formsets.
- In a Modal Window.
Getting Started
- Follow the Getting Started documentation.
- Pass llms.txt/llms-full.txt to your coding agent.
Usage
Usage in Custom Form
# File: forms.py
from django_flatpickr.widgets import DatePickerInput, TimePickerInput, DateTimePickerInput
from .models import Event
from django import forms
class ToDoForm(forms.Form):
todo = forms.CharField(widget=forms.TextInput())
date = forms.DateField(widget=DatePickerInput())
time = forms.TimeField(widget=TimePickerInput())
datetime = forms.DateTimeField(widget=DateTimePickerInput())
Implement date-range-picker
DatePickers can be linked together to select a date-range, time-range or date-time-range without writing a single line of JavaScript.
# File: forms.py
from django_flatpickr.widgets import DatePickerInput, TimePickerInput
from django import forms
class EventForm(forms.ModelForm):
class Meta:
model = Event
fields = ["name", "start_date", "end_date", "start_time", "end_time"]
widgets = {
"start_date": DatePickerInput(),
"end_date": DatePickerInput(range_from="start_date"),
"start_time": TimePickerInput(),
"end_time": TimePickerInput(range_from="start_time"),
}
- Read the full Usage doc for django-filter, django-crispy-forms, dynamic formsets and modal examples.
Customization
Contributing
License
This project is licensed under the MIT LICENSE.
Release files for django-flatpickr 2.1.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_flatpickr-2.1.0.tar.gz | 10.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_flatpickr-2.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.8 kB
Release files / django_flatpickr-2.1.0.tar.gz
| Download URL | django_flatpickr-2.1.0.tar.gz |
|---|---|
| Size | 10.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3cb3494502979b0d71e707563aeae5db766eed9fcd493614595ccdbdee471071
|
|
BLAKE2b-256 checksum How to use checksums |
d2669e028b8091144923c29296985ea6702fb51c886cab7c1e7af2e422bd8a8a
|
| 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 Sep 6, 2026.
Transparency logRelease files / django_flatpickr-2.1.0-py3-none-any.whl
| Download URL | django_flatpickr-2.1.0-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b21396a389023bec598778ce13026095b598ce8154e2eaf11932d693c7163e38
|
|
BLAKE2b-256 checksum How to use checksums |
5e2e4c485bb3342c1641899f59c1e500f826e7b0dcfa4b06126fc78671ae2fb0
|
| 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 Sep 6, 2026.
Transparency log