Blog


Django and Django Rest Framework Permissioning system

What are Permissions In Django Permissions can apply to Individual Users Groups of Users Permissions are all about Access – Who can see what? Control – Who can do what In django docs, Permissions are defined like so: Permissions [are] binary (yes/no) flags designating whether a user may perform a certain task So, the above […]




Django celery + rabbitmq + redis: Use rabbitmq as broker and redis as results backend

Celery is a task queue with focus on real-time processing, while also supporting task scheduling. RabbitMQ is a message broker. This means it handles the queue of “messages” between Django and Celery. Redis is a key-value based storage (REmote DIstributed Storage). Very fast. Used for results backend. Code for this tutorial is here: https://github.com/tek-shinobi/celeryDj Install […]




Django TDD setup

Setup 1. Create virtual env. pipenv shell 2. Install django pipenv install django 3. Create django project. django-admin startproject tested 4. Create .gitignore file touch .gitignore settings setup a settings file for tests. This will use an in-memory sqlite DB (sqlite3). This is good because we don’t want a PG or MySQL db running i/o […]




Python Descriptors

Descriptors are often overlooked part of Python. We are all aware of @property. Descriptors are what power it. So lets take a look at them. Why Descriptors Look at this code:

In this toy example, the getter always capitalizes the name before returning. Now if we wanted to implement exactly same functionality in another […]