Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change field name in django admin

I am customizing django admin and I would like to change the display name of my fields. I think the answer is here but I can't find it. I already change the table name thanks to Meta class. I have also ordered fields, gathered them, collapsed them...

like image 868
HydrUra Avatar asked Aug 29 '13 15:08

HydrUra


People also ask

How do I change the admin text in Django?

To change the admin site header text, login page, and the HTML title tag of our bookstore's instead, add the following code in urls.py . The site_header changes the Django administration text which appears on the login page and the admin site. The site_title changes the text added to the <title> of every admin page.

How do I make a field editable in Django?

To use editable in a field you must specify either of following settings: null=True and blank=True, so that your field doesn't give required error during model save.

Can we change Django admin theme?

To do so, you will have to change the project's settings.py . Find the TEMPLATES section and modify accordingly. To override the default template you first need to access the template you want to modify from the django/contrib/admin/templates/admin directory.


1 Answers

What I was looking for is :

name = models.CharField(max_length=200, verbose_name="Nom")

Thanks anyway for your help !

like image 83
HydrUra Avatar answered Oct 11 '22 22:10

HydrUra