Using the ListSerializer with bulk_update to build efficient PUT API endpoints with Django Rest Framework

Generic rest framework endpoints are typically designed to modify one object at a time. However, you will often find that this can become a huge bottleneck to performance when you need to modify thousands of objects. In this case, instead of thousands of calls to your endpoint, it is better to do one call that does the operation in bulk. This tutorial show you how to create efficient bulk updates for your PUT API’s endpoints.

In Part 1: Efficient Bulk Creates With Django Rest Framework we went over how to optimize the POST API using Django Rest Framework. In this…


Learn how to use the ListSerializer with bulk_create to build efficient POST API endpoints with Django Rest Framework

Generic rest framework endpoints are typically designed to modify one object at a time. However, you will often find that this can become a huge bottleneck to performance when you need to do thousands of create or updates. In this case, instead of thousands of calls to your endpoint, it is better to do one call that does a bulk create.

In this post, we are going to walk through how to perform efficient bulk creation of model objects using Django’s Rest Framework. A full working Django app with all of this code and unit tests can be found on…


A guide to calling Tinn, a tiny neural network in 200 lines of c, using Python with ctypes

Image by Author

At SensiML we are focused on building machine learning tools that make it easy for developers to create and deploy trained models to embedded IoT devices. In this post, I’m going to show you how to turn Tinn (a tiny neural network written in standard C) into a shared library and then to call it from Python as if it were a native Python function. We use this method at SensiML to experiment with and build C libraries that target embedded devices while still natively using our Python data science toolkit.

Step 1. Go download Tinn

If you are going to work through this tutorial…

Chris Knorowski

CTO/Cofounder of SensiML. Works at the intersection of physics, software engineering and machine learning.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store