#30850 closed Uncategorized (duplicate)
Overriding the default admin requires the custom admin site not to be in admin.py.
Reported by: | Jimmy Merrild Krag | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 2.2 |
Severity: | Normal | Keywords: | admin admin_site |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The example for overriding the default admin has a flaw.
The class MyAdminSite
cannot be in the same file as admin registrations, or they will not be registered correctly. Therefore, in the example, MyAdminSite
should be placed in another file, e.g. admin_site.py
instead, and this importance should be noted.
Change History (1)
comment:1 by , 5 years ago
Easy pickings: | unset |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
Summary: | Overriding the default admin requires the custom admin site not to be in admin.py → Overriding the default admin requires the custom admin site not to be in admin.py. |
Version 0, edited 5 years ago by (next)
Note:
See TracTickets
for help on using tickets.
It is a preferable option to create these files in a project directory not in an app directory so both paths and content of are correct in this example.
Duplicate of #30598.