[Django] #36536: Creating nested app using startapp should use full Python path for AppConfig.name

11 views
Skip to first unread message

Django

unread,
Aug 1, 2025, 2:58:45 AM8/1/25
to django-...@googlegroups.com
#36536: Creating nested app using startapp should use full Python path for
AppConfig.name
-------------------------------------+-------------------------------------
Reporter: David Sanders | Type: Bug
Status: new | Component: Core
| (Management commands)
Version: 5.2 | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Currently when you create a nested app with startapp:

{{{
./manage.py startapp example apps/example
}}}

The app config will only set `ExampleConfg.name = "example"` however the
correct value should be `"apps.example"`

I'd recommend this be accepted as a bug with what seems like an easy fix:

- We should be able to use `settings.BASE_DIR` (if it wasn't removed) and
`os.path.relpath()` to check if the specified target directory is within
the project and convert it to a Python path if so.
- If for some reason `BASE_DIR` doesn't exist or the target directory is
outside the base dir then we just leave it as the app's name ¯\_(ツ)_/¯
--
Ticket URL: <https://code.djangoproject.com/ticket/36536>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 1, 2025, 3:57:52 AM8/1/25
to django-...@googlegroups.com
#36536: Creating nested app using startapp should use full Python path for
AppConfig.name
-------------------------------------+-------------------------------------
Reporter: David Sanders | Owner: (none)
Type: Bug | Status: closed
Component: Core (Management | Version: 5.2
commands) |
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* resolution: => duplicate
* status: new => closed

Comment:

I believe this is a duplicate of #30618
--
Ticket URL: <https://code.djangoproject.com/ticket/36536#comment:1>

Django

unread,
Aug 1, 2025, 4:21:40 AM8/1/25
to django-...@googlegroups.com
#36536: Creating nested app using startapp should use full Python path for
AppConfig.name
-------------------------------------+-------------------------------------
Reporter: David Sanders | Owner: (none)
Type: Bug | Status: closed
Component: Core (Management | Version: 5.2
commands) |
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by David Sanders):

Ah thanks Sarah… I searched but didn't get that. Glad you're on top of
all the tickets ❤️

I might comment on that and ask felix to reconsider because my suggestion
is slightly different to the one in that ticket's PR
--
Ticket URL: <https://code.djangoproject.com/ticket/36536#comment:2>
Reply all
Reply to author
Forward
0 new messages