I'm trying to save date formatted as dd/mm/yyyy from a view using Django to a postgresql table. I get the following error:
ValidationError: [u"'2014/01/30' value has an invalid format. It must be in YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ] format."]
how can i change the format of a specific table or the entire database?
I've tried:ALTER DATABASE myDb SET datestyle TO "ISO, YMD";
then when i run SHOW lc_ctype; i get:
lc_ctype
-------------
en_US.UTF-8
and SELECT current_date; returns
date
------------
2014-01-29
So it looks good, what raise the question if the error is in Django
my views.py looks like this:
logEntry, created = Logs.objects.get_or_create(entrydate=request_data['entryDate'], message=request_data['message'])
logEntry.save()
and my models.py
class Logs(models.Model):
entrydate= models.DateTimeField(auto_now_add=True)
message = models.CharField(max_length=100)