Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#9127 closed (invalid)

admin.autodiscover() fails in certain structures

Reported by: panni@… Owned by: nobody
Component: contrib.admin Version: master
Severity: Keywords: autodiscover, fails, admin, folder
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Take the following structure:

-> modules

-> app1


-> app2


Admin.autodiscover() as far as I know uses imp.find_module('admin', app_path), which seems to result in looking for an inside the "admin/" folders of the apps, which I need for custom admin views, instead of directly using "" from the apps.

Change History (4)

comment:1 Changed 11 years ago by panni@…

I should've used preformattedText for the folder structure. Here it is:

    -> modules
        -> app1/

        -> app2/

comment:2 Changed 11 years ago by panni@…

Ah yeah, and the problem is, that those apps with "admin/" folders inside of them don't get displayed in the admin page.

comment:3 Changed 11 years ago by Collin Grady

Resolution: invalid
Status: newclosed

this is simply how python import behavior works - project/appname/ is identical to project/appname/admin/ - both would be project.appname.admin for an import

comment:4 Changed 10 years ago by (none)

milestone: post-1.0

Milestone post-1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top