Open in app

Sign in

Write

Sign in

Adrien Van Thong
Adrien Van Thong

22 Followers

Home

About

2 hours ago

Django tricks: how to exclude a single migration during unit tests

Have you ever written the perfect migration for your production & staging servers, but the same migration doesn’t work in your unit testing environment? This article will provide a neat trick to allow you to select specific migration files to be skipped by the unit testing framework. When & why this would be useful This recently came…

Django

2 min read

Django tricks: how to exclude a migration during unit tests
Django tricks: how to exclude a migration during unit tests
Django

2 min read


Nov 17

Django tricks: how to guarantee migration files are always up to date

Have you ever made some slight innocuous changes to you Django models, and later (sometimes, much later) found out those changes resulted in migration files that were never created? Like fixing a typo in a field’s help_text? …

Django

2 min read

Django tricks: how to guarantee migration files are always up to date
Django tricks: how to guarantee migration files are always up to date
Django

2 min read


Oct 30

Django CBVs: Top 8 most common methods to overwrite

Django’s class-based-views, or CBVs for short, provide an incredibly powerful framework which help developers to very quickly get to work on writing high-quality business logic while reducing boilerplate code. There are many methods in the various CBVs which I often overwrite for my projects — in this article I will…

Django

5 min read

Django CBVs: Top 8 most common methods to overwrite
Django CBVs: Top 8 most common methods to overwrite
Django

5 min read


Aug 17

Django: How to write custom manage.py commands

The Django framework comes with a fairly extensive library of pre-packaged admin commands executed via the manage.py interface that can make managing your site and apps easier and more automatable. Did you know that this same framework also provides a mechanism to create your own brand-new customized admin commands? Let’s…

Django

4 min read

Django: How to write custom admin commands
Django: How to write custom admin commands
Django

4 min read


Jul 31

Django tricks: Polymorphism with Generic Foreign Keys

One of the many powerful features Django brings to the mix as an ORM is the ability to introduce polymorphism to our models — a concept which becomes crucially important as applications grow and developers look to reduce repeated and boilerplate code. In this article I’ll cover what a Generic…

Django

5 min read

Django tricks: Polymorphism with Generic Foreign Keys
Django tricks: Polymorphism with Generic Foreign Keys
Django

5 min read


Jun 21

Django: How to quickly add permissions to CBVs

In this article, I will explore how to integrate permissions management with class-based-views (CBVs) in Django. Like most concepts in Django, the solution is straightforward, though it is important to first establish some of the concepts beforehand. Default Django Permission schemes Django automatically creates permission schemes for each model in your project, following a…

Django

4 min read

Django: How to quickly add permissions to CBVs
Django: How to quickly add permissions to CBVs
Django

4 min read


May 5

Django: Using django-filter plugin with CBVs

Django-filter is an extremely powerful plugin for Django which extends the framework by providing a common set of APIs for easily setting up and managing user-facing filters on models. This plugin provides an immense amount of new functionality, all while avoid further boilerplate code for developers. This plugin is so…

Django

4 min read

Django: Using django-filter plugin with CBVs
Django: Using django-filter plugin with CBVs
Django

4 min read


Apr 20

Django: How to write a bulk “custom action” view using CBVs

In a previous article, I showcased how to leverage Django’s built-in capabilities to create a bulk edit form for the fields in a set of records for a Django model. I’ve recently had a need for a use case in a similar vein, but with a different application: implementing a…

Django

4 min read

Django: managing foreign key relationships in bulk using CBVs
Django: managing foreign key relationships in bulk using CBVs
Django

4 min read


Mar 9

Django Tricks: How to pass querysets from a View to a Form

In a previous article, I showcased how to create a bulk edit form in Django using class based views. Recently, the use case came up where I needed to change the queryset for the FormSet such that it could filter based on the currently logged in user. The problem I…

Django

3 min read

Django Tricks: How to pass querysets from a View to a Form
Django Tricks: How to pass querysets from a View to a Form
Django

3 min read


Mar 2

Django: How to write a customized bulk edit page using class based views

The Django framework is an extremely powerful tool at helping build applications quickly while helping drastically reduce the amount of boilerplate code. …

Django

10 min read

Django: How to write a customized bulk edit view in a class based view
Django: How to write a customized bulk edit view in a class based view
Django

10 min read

Adrien Van Thong

Adrien Van Thong

22 Followers

Software Engineer.

Following
  • Joe Kinsella

    Joe Kinsella

  • Claire Lew

    Claire Lew

  • Tech We Want

    Tech We Want

  • President Joe Biden

    President Joe Biden

  • Steve Haapaoja

    Steve Haapaoja

See all (13)

Help

Status

About

Careers

Blog

Privacy

Terms

Text to speech

Teams