From 091ffc4e5eb35776864b853973097588a36f169e Mon Sep 17 00:00:00 2001 From: Amar Ahmed Deina Date: Wed, 7 Jan 2026 02:47:58 +0000 Subject: Fixed #36844 -- Clarified need for reusable apps to set default_auto_field in packaging tutorial and AppConfig docs. --- docs/intro/reusable-apps.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'docs/intro') diff --git a/docs/intro/reusable-apps.txt b/docs/intro/reusable-apps.txt index 627cf3292e..bb33dc0197 100644 --- a/docs/intro/reusable-apps.txt +++ b/docs/intro/reusable-apps.txt @@ -143,8 +143,10 @@ this. For a small app like polls, this process isn't too difficult. to ``django_polls``. #. Edit ``django_polls/apps.py`` so that :attr:`~.AppConfig.name` refers to the - new module name and add :attr:`~.AppConfig.label` to give a short name for - the app: + new module name, add :attr:`~.AppConfig.label` to give a short name for + the app, and set :attr:`~.AppConfig.default_auto_field` to ensure your + migrations are not affected by changes to :setting:`DEFAULT_AUTO_FIELD` + made by users of your reusable app: .. code-block:: python :caption: ``django-polls/django_polls/apps.py`` @@ -153,6 +155,7 @@ this. For a small app like polls, this process isn't too difficult. class PollsConfig(AppConfig): + default_auto_field = "django.db.models.BigAutoField" name = "django_polls" label = "polls" -- cgit v1.3