Change form date input format

I have a form on my page where the user needs to enter a date. I also have a DatePicker widget associated with this field in the form.
image

This is the field in my model:

date = models.DateField(default=timezone.now,
                            help_text=f'eg. {str(timezone.now().date())}',
                            validators=[MinValueValidator(timezone.now().date()),
                                        MaxValueValidator((timezone.now() + timedelta(days=365)).date())
                                        ])

This is the field within my form:

date = forms.DateField(
        widget=forms.DateInput(format="%d/%m/%Y",
                               attrs={'type': 'date',
                                      'min': str(timezone.now().date()),
                                      'max': str((timezone.now() + timedelta(days=365)).date())}),
        help_text='Select a date',
        input_formats=["%d/%m/%Y"],
        validators=[validate_future_date],
    )

This is how the HTML is being rendered when I access the page:

<div id="div_id_date" class="form-group"> 
   <label for="id_date" class=" requiredField"> 
       Date
       <span class="asteriskField">*</span> 
   </label>
   <div> 
      <input type="date" name="date" min="2024-03-24" max="2025-03-24" class="dateinput form-control" required="" id="id_date"> 
      <small id="hint_id_date" class="form-text text-muted">Select a date</small> 
   </div> 
</div>

I want to change the date input format to dd/mm/yyyy, but no matter what I try it always remains the same ( mm/dd/yyyy ). Please help

Side note: When posting code here, enclose the code between lines of three backtick - ` characters. This means you’ll have a line of ```, then your code, then another line of ```. This forces the forum software to keep your code properly formatted. (I’ve taken the liberty of fixing your original post for you.)

What DatePicker widget are you using? I’m guessing it’s that that needs to be configured. (It might also be useful if you posted the HTML for that field as it has been rendered and is being displayed in the browser.)

Any JavaScript you’re using (such as the DatePicker) is going to override whatever you’ve defined in the Django form.

Thank you, I did not know I can format my code on the forum.
I added the HTML for the form field

The only thing I’m using to pick the date is:

widget=forms.DateInput()

within the form.

Note: Django uses 'type': 'text' for date fields so that it can have control over that field. When you specify 'type': 'date', you’re yielding control over to the browser.

Quoting from the blue note box at <input type="date"> - HTML: HyperText Markup Language | MDN

Note: The displayed date format will differ from the actual value — the displayed date is formatted based on the locale of the user’s browser , but the parsed value is always formatted yyyy-mm-dd .