About Choices of Geographic Lists

When adding fields like country or timezone to your models, don't set the choices argument to a static list or tuple. Instead use a callable (e.g. a function that returns a list of choices). This way, Django won't require to create new migrations when list items change because due to political updates like a country name change or a timezone adjustment.

import zoneinfo
from django.contrib.auth.models import AbstractUser

def get_timezone_choices():
    return [(tz, tz) for tz in sorted(zoneinfo.available_timezones())]

class User(AbstractUser):
    timezone = models.CharField(
        max_length=50, choices=get_timezone_choices, default="UTC"
    )

Tips and Tricks Programming Django 5.2 Django 4.2