Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#8572 closed (duplicate)

Improve flexibility of admin.autodiscover for custom admin sites

Reported by: Manuel Saelices Owned by: Manuel Saelices
Component: contrib.admin Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

admin.autodiscover is great, but you cannot customize admin sites. It would be wonderful that you can call autodiscover with a optional site parameter, like this:

# urls.py

from django.contrib import admin

from yourproject.admin import custom_admin_site

admin.autodiscover(site=custom_admin_site)

urlpatterns = patterns('',
    ...
    ('^admin/(.*)', custom_admin_site.root),

I will attach a patch that implement that feature, without backwards incompatibility

Attachments (2)

autodiscover_improvement_r8596.diff (3.3 KB ) - added by Manuel Saelices 16 years ago.
autodiscover_improvement_r8596.2.diff (3.7 KB ) - added by Manuel Saelices 16 years ago.
I've missing to modify django.contrib.sites.admin

Download all attachments as: .zip

Change History (7)

by Manuel Saelices, 16 years ago

by Manuel Saelices, 16 years ago

I've missing to modify django.contrib.sites.admin

comment:1 by Julien Phalip, 16 years ago

I'm +1 on this. At the moment I'm using an ugly workaround to achieve the same thing:

admin.autodiscover()
custom_admin_site = admin.site

comment:2 by Brian Rosner, 16 years ago

Resolution: duplicate
Status: newclosed

This is a duplicate of #8500. I think this approach is better, but it is best to keep this all in one place.

comment:3 by Manuel Saelices, 16 years ago

@brosner, this approach is #8500 aproach or #8572 one?

comment:4 by Manuel Saelices, 16 years ago

I think this ticket approach permit you to define two custom sites and call admin.autodiscover in a natural way:

admin.autodiscover(site1)
admin.autodiscover(site2)

comment:5 by Manuel Saelices, 16 years ago

@brosner, sorry I didn't see your comment at #8500. You referred that this patch maybe would be better.

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