Django

Sep 05, 2023

Add style to Django forms with TailwindCSS

You can style Django forms with Tailwind CSS without Crispy forms or installing any other external libraries. If you already have Tailwind CSS installed in your Django project, all you need is Django’s built-in “widget” feature, more specifically, the attrs field.

Jun 05, 2023

Django Testing: Dynamically Accessing Attributes in Unit Tests

In this blog post, we’ll explore a way to write unit tests for a Django model using Model Mommy. Our main focus is on the update_dog_from_data function, which updates a Dog object with JSON data. However, the highlight is the technique to dynamically access attribute values in the tested object. By the end, you’ll learn some unit testing strategies and gain insights into dynamically interacting with object attributes during testing.