I am working on a form and have a date field. I want to save a different date format for the date field instead of django. I get the date "01-jan-2016" and want to save as in my database. When I try to save the same format, an error occurs
[u"'07-Dec-2016' value has an invalid date format. It must be in YYYY-MM-DD format."].
I know this question has already been asked, but they do not solve my problem.
views.py
post_date = request.POST['date']
lead_obj = CustomerLeads.objects.create(posting_date = post_date)
my models.py
class Leads(models.Model):
customer_name = models.CharField(max_length=50,null=True, blank=True)
title = models.CharField(max_length=100, null=True, blank=True)
posting_date = models.DateField()
source
share