Date format in Django Model field with REST API
Building a test exercise for a company using Django Rest API. Stuck at date format in Django Model field. I need format like this %d-%m-%Y, but all data I get in format 2021-12-20. Here is what I've done. models.py
created_at = models.DateField(auto_now_add=True, verbose_name='Создана')
updated_at = models.DateField(auto_now=True, verbose_name='Обновлена')
settings.py
DATE_INPUT_FORMATS = ['%d-%m-%Y']
DATE_FORMAT = "d-m-Y"
USE_I18N = False
USE_L10N = False
USE_TZ = False
Also I need to get and POST data via API call in this view:
- GET /drivers/driver/?created_at__gte=22-11-2021