diff options
| author | Amar Ahmed Deina <amarmed4500@gmail.com> | 2026-01-07 02:47:58 +0000 |
|---|---|---|
| committer | Jacob Walls <jacobtylerwalls@gmail.com> | 2026-01-08 10:21:08 -0500 |
| commit | 8230e9b7fad10d4a13a9d6c1001782f799f567c6 (patch) | |
| tree | a79f7c4107c08fa89dd07a675ad1914090ed287d /docs/intro | |
| parent | 770c4f9e20664d632c8243f9cd203478a8b03dce (diff) | |
[6.0.x] Fixed #36844 -- Clarified need for reusable apps to set default_auto_field in packaging tutorial and AppConfig docs.
Backport of 091ffc4e5eb35776864b853973097588a36f169e from main.
Diffstat (limited to 'docs/intro')
| -rw-r--r-- | docs/intro/reusable-apps.txt | 7 |
1 files changed, 5 insertions, 2 deletions
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" |
