[Django] #34725: get_containing_app_config does not find an object in a module imported with an absolute path from project root

2 views
Skip to first unread message

Django

unread,
Jul 20, 2023, 9:42:45 AM7/20/23
to django-...@googlegroups.com
#34725: get_containing_app_config does not find an object in a module imported
with an absolute path from project root
-----------------------------------------+------------------------
Reporter: piscvau | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 4.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 |
-----------------------------------------+------------------------
in a test file where I need to import a Model module with an absolute path
of type :
<base_dir>.<app_dir>.<models>.<module>

the get_containing_appconfig(self, object_name) of registry does not find
the app_config, because the object name does not start with the appname.
consequently, an exception is raised indicating that the model is not in
an application in INSTALLED_APPS which is incorrect

--
Ticket URL: <https://code.djangoproject.com/ticket/34725>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 20, 2023, 10:43:01 AM7/20/23
to django-...@googlegroups.com
#34725: get_containing_app_config does not find an object in a module imported
with an absolute path from project root
-------------------------------+--------------------------------------
Reporter: piscvau | Owner: nobody
Type: Bug | Status: closed
Component: Uncategorized | Version: 4.2
Severity: Normal | Resolution: needsinfo

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 Natalia Bidart):

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


Comment:

Hello,

Could you please provide a sample test app that showcases the exception?
We would need concrete instructions on how to reproduce the issue.

At first, with the provided details, this seems to be a configuration
issue in your project, so you could also seek for help using any of the
user support channels from [https://docs.djangoproject.com/en/dev/faq/help
/#how-do-i-do-x-why-doesn-t-y-work-where-can-i-go-to-get-help this link].

--
Ticket URL: <https://code.djangoproject.com/ticket/34725#comment:1>

Reply all
Reply to author
Forward
0 new messages