Opened 15 years ago
Closed 6 years ago
#8500 closed New feature (fixed)
Allow overriding of default adminsite.
Reported by: | oyvind | Owned by: | oyvind |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Normal | Keywords: | override adminsite |
Cc: | tinodb, kmike84@…, raffaele.salmaso+djangoproject@… | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
It would be great to be able to replace the default adminsite in settings.
For example, all contrib apps assume you use the default adminsite.
Would also make it easier for contrib app to just "snap in" another site to add functionality to the admim.
Attachments (3)
Change History (19)
Changed 15 years ago by
Attachment: | default_admin_site_override.diff added |
---|
comment:2 Changed 15 years ago by
Summary: | Allow overridimg of default adminsite. → Allow overriding of default adminsite. |
---|
Changed 15 years ago by
Attachment: | default_admin_site_override_2.diff added |
---|
comment:3 Changed 15 years ago by
Triage Stage: | Unreviewed → Design decision needed |
---|
Marked #8572 as a duplicate. I think that approach might be better, but certainly a post-1.0 thing.
comment:5 Changed 15 years ago by
I'm not sure I understand the approach taken there, at present the admin.autodiscover() has no knowledge of the adminsite.
comment:7 Changed 14 years ago by
milestone: | → 1.2 |
---|---|
Triage Stage: | Design decision needed → Accepted |
comment:9 Changed 14 years ago by
milestone: | 1.2 |
---|
1.2 is feature-frozen, moving this feature request off the milestone.
comment:10 Changed 12 years ago by
Severity: | → Normal |
---|---|
Type: | → New feature |
comment:11 Changed 12 years ago by
Easy pickings: | unset |
---|---|
Patch needs improvement: | set |
8500.1.diff fails to apply cleanly on to trunk
comment:12 Changed 12 years ago by
Cc: | tinodb added |
---|---|
UI/UX: | unset |
comment:13 Changed 11 years ago by
Cc: | kmike84@… added |
---|
comment:15 Changed 7 years ago by
Hi, I usually override the default admin site with my custom version, then found this ticket, so I choose to complete it.
The first PR was using a new setting (ADMIN_SITE_CLASS
), but I rewrote it to use a custom (Simple
)AdminConfig
and no new setting.
The idea is to delay site instance creation only to when needed with LazyObject, so django.apps can be fully loaded and can access the required attribute.
Using an helper function as the first patch cannot work because require a new setting, and we wanto to avoid that.
This version doesn't require to adapt current code with a
def register(site): ...
as the last patch require, or rewriting code not to use django.contrib.admin.sites.site
directly.
comment:16 Changed 7 years ago by
Patch needs improvement: | unset |
---|
comment:17 Changed 7 years ago by
Cc: | raffaele.salmaso+djangoproject@… added |
---|
comment:18 Changed 6 years ago by
Triage Stage: | Accepted → Ready for checkin |
---|
another possible solution