All Posts Create a Post
How to display serializer in delete action with django rest swagger
By default, django rest swagger doesn’t displayed the Serializer in DELETE method. But, for some reason I need to implement prevent deletion & force deletion case. So, basicly to implement …
Django rest clean up before validation
Sometime we need to clean up the value before it validated by an exiting validations. For example, when user sended an longitude and latitude data into backend with multiple length …
How to custom select language icon in django administration
1. Add the base_site file inside templates/admin/base_site.html. {% extends "admin/base.html" %} {% load static i18n %} {% block title %}{{ title }} | {{ site_title|default:_('Situs django admin') }}{% endblock %} …
How to setup all raw_id_fields and search_fields for django
For example I have this 3 fields as question_set, question and folder. I need to assign all of this fields into raw_id_fields inside the admin.ModelAdmin without add manually per-single fields. …
Awesome django books by agiliq.com
This awesome django books for refference is also open sourced at https://github.com/agiliq/books Django Admin Cookbook (Django 2.0) Django ORM Cookbook (Django 2.0) Building APIs with Django and Django Rest Framework …
How to automaticly backup your projects into external hardisk in ubuntu?
Rsync, which stands for “remote sync”, is a remote and local file synchronization tool. It uses an algorithm that minimizes the amount of data copied by only moving the portions …
How to create Django Language Middleware
This example below to setup default language code as id (Indonesian). Your file middleware.py # -*- coding: utf-8 -*- from django.conf import settings from django.utils import translation from django.utils.deprecation import …
How to make a notification when terminal process is complete
I have started a long process through a terminal. Is it possible to make the Ubuntu terminal make a sound once the process is complete? This way, I don’t need …
Django Standard API Response Middleware for DRF
As you can see, if you using django-rest-framework, you will found many different response format. This middleware to solve all of these problems with implement the Standard API Response. All …
IDGenerator
Generate a unique identifier of a specified fixed length consisting of the characters 0-9 and a-z. For example: zcgst5od 9x2zgn0l qa44sp0z 61vv1nl5 umpprkbt ylg4lmcy dec0lu1t 38mhd8i5 rx00yf0e kc2qdc07 Here is …