#33378: ImproperlyConfigured error is raised when installing apps in
subdirectory
-------------------------------------+-------------------------------------
Reporter: Zack West | Owner: nobody
Type: Bug | Status: closed
Component: Core (Management | Version: 4.0
commands) |
Severity: Normal | Resolution: duplicate
Keywords: Apps, Subdirectory, | Triage Stage:
Installation | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Zack West):
Thanks and sorry for the duplicate post. It wasn't so much the requirement
of the full path I noted as much as it was Django *generating* a non-
fullpath when running the `python manage.py startapp` command or, more
particularly, if one is in a subdirectory (e.g. apps/) and runs the
command `django-admin startapp myapp` the `name` field in
`apps/myapp/apps.py` config class gets auto-populated with just `myapp`
rather than the required `apps.myapp` which will throw a
`django.core.exceptions.ImproperlyConfigured` exception unless a user
manually updates the `name` field.
I understand if that was passed over but I wanted to ensure I was drawing
attention to the proper aspect of the issue.
Replying to [comment:1 Mariusz Felisiak]:
> Thanks for the report, however it works exactly the same in Django 3.2,
3.1, etc. I don't see any change in this behavior. `AppConfig.name` must
be a full Python path to the application, as
[https://docs.djangoproject.com/en/4.0/ref/applications/#django.apps.AppConfig.name
documented], so in your case `Apps.bestapp` is required and expected. We
tried to improve generated `apps.py` files in #30618 but it was clunky.
>
> Duplicate of #30618.
--
Ticket URL: <https://code.djangoproject.com/ticket/33378#comment:2>
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 on the web visit
https://groups.google.com/d/msgid/django-updates/068.44c3275b70a8efa3ce360a816e47404d%40djangoproject.com.