Blog

Page 128 of my articles, tutorials, and thoughts

Latest Articles

Cover Image for In Django, how do I check if a user is in a certain group?
python

In Django, how do I check if a user is in a certain group?

Published on September 2, 2023

šŸ‘‹ Hey there Django developer! šŸ‘©ā€šŸ’» So, you've created a custom group in Django's admin site šŸ™Œ, and now you want to check if a user is in this group. That's a great question! Let's dive into it and solve this problem together. šŸ’Ŗ ## The Challenge šŸ’„ Y

Cover Image for How to view corresponding SQL query of the Django ORM"s queryset?

How to view corresponding SQL query of the Django ORM"s queryset?

Published on September 2, 2023

# How to View the Corresponding SQL Query of the Django ORM's Queryset? So, you're working with Django ORM and you want to know how to view the underlying SQL query that it generates. Don't worry, you're not alone! Many developers, like you, find themsel

Cover Image for How to disable admin-style browsable interface of django-rest-framework?

How to disable admin-style browsable interface of django-rest-framework?

Published on September 2, 2023

# How to Disable the Admin-Style Browsable Interface of Django Rest Framework So, you're using the amazing Django Rest Framework (DRF), and it's providing you with a beautiful admin style browsable self-documenting API. But uh-oh! Anyone can visit those p

Cover Image for How to convert a Django QuerySet to a list?

How to convert a Django QuerySet to a list?

Published on September 2, 2023

šŸ“ How to Convert a Django QuerySet to a List Are you having trouble converting a Django QuerySet to a list? Don't worry, you're not alone! Many developers face this issue when working with Django. In this blog post, we'll dive into common issues around c

Cover Image for How to select a record and update it, with a single queryset in Django?

How to select a record and update it, with a single queryset in Django?

Published on September 2, 2023

šŸ“ **Title:** A Single Queryset to Select and Update Records in Django: The Easy Way! šŸ’ŖšŸ’„ āœļø **Introduction:** Welcome, fellow Django enthusiasts! Are you tired of writing multiple queries just to select and update a single record? Well, fret no more! In

Cover Image for Django: "projects" vs "apps"
namespacespython

Django: "projects" vs "apps"

Published on September 2, 2023

šŸ“ **Django: "projects" vs "apps"** If you're new to Django, you may have come across the terms "projects" and "apps" and wondered what they mean exactly. In this blog post, we'll tackle this question, address common issues, provide easy solutions, and le

Cover Image for How can I call a custom Django manage.py command directly from a test driver?
unit-testing

How can I call a custom Django manage.py command directly from a test driver?

Published on September 2, 2023

# Calling Custom Django manage.py Command from a Test Driver šŸšŸ’» So, you want to write a unit test for your Django `manage.py` command but you're stuck, huh? Don't worry, we got your back! šŸ¤— In this blog post, we will address the common issue of invokin

Cover Image for How to limit the maximum value of a numeric field in a Django model?
python

How to limit the maximum value of a numeric field in a Django model?

Published on September 2, 2023

# How to Limit the Maximum Value of a Numeric Field in a Django Model? šŸ”¢šŸ“ So you're working on a Django project and you have a numeric field in one of your models. You want to restrict the values that can be entered into that field to a specific range o

Cover Image for Backwards migration with Django South

Backwards migration with Django South

Published on September 2, 2023

šŸ” Backwards Migration with Django South: Rollback like a Pro! šŸ’„ So you've made some changes to your models in Django, run the migration using South, and now you're feeling like you're stuck between a rock and a hard place. Don't fret, my tech-savvy frie

Blog | Matheus Mello