django datepicker 1

django datepicker

pip install django-bootstrap-datepicker-plus

Here is what the above code is Doing:
1. We’re importing the Django forms module.
2. We’re importing the Post model.
3. We’re creating a class called PostForm that inherits from forms.ModelForm.
4. We’re creating a Meta class that tells Django which model should be used to create this form (model = Post).
5. We’re telling Django to use two fields from that model: title and text.
6. We’re telling Django to create a form field for the title field of the Post model.
7. We’re telling Django to create a form field for the text field of the Post model.
8. We’re telling Django to create a form field for the created_date field of the Post model.
9. We’re telling Django to create a form field for the published_date field of the Post model.

Similar Posts