In this tutorial, we will see how it is easy to add extra context variables to change_list or change_form in Django Admin.
Continue ReadingHow to do advanced filtering with Django admin ?
In this tutorial we will learn basic, custom and advanced filtering like chaining filters with the Django admin.
Continue ReadingHow to customize Django Admin index page and add a chart ?
April 2020
The purpose of this tutorial is to demonstrate how to customize the Django admin index page and add a chart easily using the library django-chartJs.
Continue ReadingHow to make Ajax request in Django Admin changeview page ?
April 2020
In this tutorial, we will learn how to create an Ajax request to validate some data while editing a value of a model in the Django Admin change_form.
Continue ReadingHow to display foreign key values to listview page ?
April 2020
In this tutorial we will learn how to customize the listview page of a specific model to show the values of a foreign key.
Continue ReadingHow to add a database view to Django admin?
April 2020
Sometimes we want to display data which come from a database view and not from a Django model. It could be a view calculated by a stored procedure. It is super easy to do that.
Continue ReadingHow to initialize an inline formset and do some custom validations
April 2020
You can find the source code in this repository
In previous tutorial we have seen how to add inlines in our django admin for Shop and Product models. This tutorial explains how to go a step further. Let’s imagine our user has set the planning for his shop and now you like to add a new product. It could be nice to avoid him setting again the planning for the product and so to initialize it with the planning of the shop as default values.
Continue ReadingHow to add or edit models and related model on same page ?
April 2020
Sometimes when editing or adding a model in the admin, we would like to add values for related models at the same time. That’s the purpose of this tutorial
Continue ReadingHow to customize django admin login page
April 2020
This tutorial is the first one of a series dedicated to django admin interface customization. Today, we will learn how to replace the default django admin login page with a new shiny one.
Continue ReadingHow to add a custom field in listview page ?
April 2020
To display fields of a model in listview page of the admin, we use the instruction :
list_display = ('user','refShop','title')
which tells django admin which fields to display. But what if we want to add a custom field such as a button, a link or a calculated field ?
Continue Reading