Django admin provides some default actions to perform in bulk in list view. You can add a custom...
Remove bulk delete action from django admin
Django admin provides multiple options in list view like delete records in bulk. See the image below for your...
Set environments in django
Setting up environments in django is quite easy. You need to install “django-configurations” module to add multiple environments....
Raw query data/result to dictionary or grouped result set – Django
Many times we need to execute raw query instead of using built-in ORM. In this case it will...
Add/subtract week, month, year to current date in python/django
You can add weeks, months and years to current date using dateutil.relativedelta module. As shown below, using dateutil.relativedelta...
add/subtract timedelta to current or specific time – python/django
Sometimes it is required to add/subtract an amount of time to current or any specific time. We can...
Single quoted string to dictionary
Json.loads(string) expects double quoted string as parameter. If you have a string with single quotes, and try to...
Sort dictionary by value
Sorting the recordset is very basic and frequently used requirement. Let’s assume that you have a dictionary as...
Create response middleware in django
A response middleware is called just before returning the response to the client. If you want to modify...
Create custom object manager in django admin
In django, generally you can query on a model like: Products.objects.all() Or if you want to apply a...