Creating a custom user model in Django using AbstractBaseUser is a common practice when building Django Rest Framework (DRF) applications. This approach allows you to have full control over the user model and tailor it to your project’s specific needs. Here are some best practices for creating a custom user model with AbstractBaseUser in DRF:…
Day: September 3, 2023
Django and InfluxDB to save sensor data
Using Django and InfluxDB to save sensor data is a powerful combination, as InfluxDB is a time-series database that’s well-suited for storing and querying time-series data like sensor readings. Here’s a step-by-step guide on how to set up Django to save sensor data into InfluxDB: Replace ‘your-influxdb-token’, ‘your-influxdb-organization’, and ‘your-influxdb-bucket’ with your InfluxDB credentials and…
Django. JWT (JSON Web Tokens)
Django Rest Framework (DRF) is a powerful toolkit for building Web APIs in Django. JWT (JSON Web Tokens) is a popular authentication method for securing RESTful APIs. Here, I’ll provide you with an example of how to implement JWT authentication in a Django Rest Framework project. First, make sure you have Django and Django Rest…
