LDAP(Lightweight Directory Access Protocol) is a popular way to control access in enterprise environments. In this post, I will demonstrate how this can be used with django. Setup LDAP module – django-auth-ldap LDAP Server – Forum Systems LDAP Browser/editor(Optional) – Apache Directory Studio. Demo Project The demo project will...
Django admin is a very valuable tool for developers especially during the development phase. Normal way of registering a model to the admin is as below.
from myapp.models import MyModel
list_display = ['field1','field2', 'field3']
#any additional configurations
Four lines of code for a single model. Now consider the amount of repeated code required if you have 10 models in...
Starting from Version 1.11 (April 2017), Django ORM comes with Union, Intersection and Difference capabilities . While it was possible to implement this capability our own, it is nicer to have the ‘batteries included’. Lets examine this capability using a simple model.
name = models.CharField(max_length=1)
I have added some sample data so...