Am new in Django so any help will be appreciated, I have a model that contain 3 fields , one of them is date , i want to change the display of date in Django Admin(now it's 2022-05-20 but i want it to be 20-05-2022).
How i can do that please !
this is my models.py:
class reports(models.Model):
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
project_name = models.CharField(verbose_name="Project name", max_length=60)
date = models.DateField(verbose_name="Date", default=date.today)
def __str__(self):
return str(self.user)
and this is my admin.py:
class reportsAdmin(admin.ModelAdmin):
@admin.display(description='date')
def admin_date(self, obj):
return obj.date.strftime('%d-%m-%Y')
list_display = ('user', 'project_name', 'admin_date')
admin.site.register(reports, reportsAdmin)
and in my settings.py:
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = False
USE_TZ = True
but nothing work , still display to me in format 2022-05-20(year-month-date).
How i can correctly change the format date to be date-month-year in Django admin???