#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.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/01070198646cf1d0-4e5af2d7-0710-4c83-8ddc-960642641bde-000000%40eu-central-1.amazonses.com.