﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
36844	Update packaging tutorial and AppConfig docs to mandate setting default_auto_field for reusable apps	Jacob Walls	Amar	"A reusable (third-party) app that:
- has models
- but does ''not'' set `AppConfig.default_auto_field`

is in a [https://github.com/django/django/pull/20319#discussion_r2631747194 ""completely broken"" situation], given that any user attempting to use `DEFAULT_AUTO_FIELD` in their own settings will generate migrations for the reusable app, which can conflict with later migrations shipped by that app, or possibly get stored in the app's installation location:

> Third-party apps should set default_auto_field so that the migrations the app includes match the models.

This discussion took place in a [https://github.com/django/django/pull/20319 PR that was not accepted] proposing to advise on user workarounds. Instead, I think we should advise app authors to do the right thing.

That would include:
- strengthening the wording in `AppConfig.default_auto_field` docs, replacing ""You can use this... for third party applications"" to something like ""Third-party applications *must* set this ...""
- Fixing the tutorial to show this step under [https://docs.djangoproject.com/en/dev/intro/reusable-apps/#packaging-your-app ""Packaging your app""]. To my knowledge (I'm hoping someone will confirm), when you follow the tutorial and arrive at this step modeling how to make your app reusable, there is no `default_auto_field` attribute on the `AppConfig` in apps.py.

This would be an approachable issue for a new contributor, as it involves following the tutorial to verify completeness and accuracy."	Cleanup/optimization	closed	Documentation	dev	Normal	fixed			Ready for checkin	1	0	0	0	1	0
