By default, Django comes with a SelectDateWidget which most people are familiar with. It looks like this:
from django.forms.extras.widgets import SelectDateWidget class FooForm(forms.Form): date = form.(widget=SelectDateWidget())
Here are some useful snippets I’ve found if you wanted an output that is Month/Year or with time component.
To use it, just create a new file called widgets.py (anyname will do but widgets makes most sense) in the app that would be using this widget. Import it as per normal into your forms document. If you’re going to be using both snippets in the same widgets.py document, be sure to update the __all__ field to include the classes you want to use. To use the above mentioned examples, it should look like this:
__all__ = ('MonthYearWidget', 'SplitSelectDateTimeWidget')