All Posts Create a Post  
0
votes
11
views
Django rest clean up before validation
Posted at 6 days, 7 hours ago / Oct. 22, 2020, 11:14 a.m.

Something 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 …

101 1 1 0
0
votes
126
views
How to setup all raw_id_fields and search_fields for django
Posted at 2 weeks, 3 days ago / Oct. 11, 2020, 8:04 a.m.

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. …

101 1 1 0
0
votes
116
views
Awesome django books by agiliq.com
Posted at 2 weeks, 3 days ago / Oct. 11, 2020, 8:04 a.m.

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 …

101 1 1 0
0
votes
143
views
How to create Django Language Middleware
Posted at 2 weeks, 3 days ago / Oct. 11, 2020, 8:04 a.m.

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 …

101 1 1 0
1
votes
309
views
Django Standard API Response Middleware for DRF
Posted at 2 weeks, 3 days ago / Oct. 11, 2020, 8:04 a.m.

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 …

101 1 1 0
0
votes
254
views
IDGenerator
Posted at 2 weeks, 3 days ago / Oct. 11, 2020, 8:04 a.m.

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 …

101 1 1 0
0
votes
218
views
Deploy Django at Heroku
Posted at 2 weeks, 3 days ago / Oct. 11, 2020, 8:04 a.m.

1. Install heroku cli https://devcenter.heroku.com/articles/heroku-cli 2. Add Procfile to your project, and add this command below: $ cd yourenv/yourproject/ $ vim Procfile # then, add this command below to the …

101 1 1 0
0
votes
164
views
Python numberize until undefined or infinity numbers
Posted at 2 weeks, 3 days ago / Oct. 11, 2020, 8:04 a.m.

Something we need to create the function to convert the number into string number, for example: 1000 to 1.0 k, 1000000 to 1.0 m, etc. def numberize(number): scales = { …

101 1 1 0
0
votes
182
views
Upload to PyPi using twine
Posted at 2 weeks, 3 days ago / Oct. 11, 2020, 8:04 a.m.

The Python Package Index (PyPI) is a repository of software for the Python programming language. PyPI helps you find and install software developed and shared by the Python community. 1. …

101 1 1 0
0
votes
185
views
difflib similarity
Posted at 2 weeks, 3 days ago / Oct. 11, 2020, 8:04 a.m.

This module provides classes and functions for comparing sequences. It can be used for example, for comparing files, and can produce difference information in various formats, including HTML and context …

101 1 1 0
  Page 1 of 9