Category: Django

Django access control using LDAP

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 Unit Testing in VSCode

While PyCharm Pro might be the most popular IDE for Python development, the community version supports neither Django nor JavaScript . VSCode is a free opensource alternative which has pretty good Python support. Python is supported in VSCode using an extension.  A quick start guide on the extension can be found...

Auto registering models in Django Admin

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.

  Four lines of code for a single model. Now consider the amount of repeated code required if you have 10 models in...

Django ORM Union, Intersection and Difference

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.

I have added some sample data so...