#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)
Change History (7)
by , 16 years ago
Attachment: | autodiscover_improvement_r8596.diff added |
---|
by , 16 years ago
Attachment: | autodiscover_improvement_r8596.2.diff added |
---|
comment:1 by , 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 , 16 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
This is a duplicate of #8500. I think this approach is better, but it is best to keep this all in one place.
comment:4 by , 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 , 16 years ago
@brosner, sorry I didn't see your comment at #8500. You referred that this patch maybe would be better.
I've missing to modify django.contrib.sites.admin