﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
35978	Django Rest Framework - How do i actually use a custom date format?	Federico_Bucciero		"Hi there,
using drf, i developed a simple api for an internal project.
I got asked to change the format of the date field from the ISO format ""%Y-%m-%d"" to the format '%d.%m.%Y'.
I read and re-read the documentation, jumped from forum and discussion, but i can't find a working solution.
The project structure is:
project/
  api/
    __init__.py
    formats/
      __init__.py
      it/
        __init__.py
        formats.py
    migrations/
    admin.py
    apps.py
    ...
  backend/
    __init__.py
    asgi.py
    settings.py
    urls.py
    wsgi.py

in project/backend/settings.py i have set
LANGUAGE_CODE = 'it'
FORMAT_MODULE_PATH = ['api.formats',]

and in project/api/formats/it/formats.py i have set
DATE_INPUT_FORMATS = [
    '%d/%m/%y',
    '%d/%m/%Y',
    '%d.%m.%Y',
    '%d.%m.%y',
    '%Y-%m-%d',
    # etc
]

but still doesn't work, and fails my request, asking for a date in format '%Y-%m-%d'
The documentation doesn't help really much undestanding how to properly customize the format, as this ""The locale-dictated format has higher precedence and will be applied instead."" tries to imply that customization is impossible.

Django version: 5.1.4
djangorestframework version: 3.15.2
      "	Uncategorized	closed	Documentation	5.1	Normal	invalid	DATE_INPUT_FORMAT		Unreviewed	0	0	0	0	0	0
