About Default Auto Field

If you are developing a third-party Django app that is providing any models, always set the default_auto_field in the apps.py.

class MyAppConfig(AppConfig):
    default_auto_field = "django.db.models.BigAutoField"
    # or default_auto_field = "django.db.models.AutoField"

Otherwise, the individual DEFAULT_AUTO_FIELD setting at a project level will trigger database migration creation in your app whenever it doesn't match your apps' migrations and a developer runs makemigrations.

Tips and Tricks Programming Django 5.2 Django 4.2 Django 3.2

Django/Python Consulting

If you have a specific Django challenge or integration you'd like to solve, I'd be happy to help. Book a free 30-minute call to discuss your project, see if we're a good fit, and explore the best approach for your needs. After the call, you'll receive a tailored cost estimate based on what we discuss.