Opened 7 years ago

Closed 7 years ago

Last modified 7 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: UI/UX:


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 7 years ago by panni@…

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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

    -> modules
        -> app1/

        -> app2/

comment:2 Changed 7 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 7 years ago by cgrady

  • Resolution set to invalid
  • Status changed from new to closed

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 7 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

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