Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#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 Mariusz Felisiak, 5 years ago

Easy pickings: unset
Resolution: duplicate
Status: newclosed
Summary: Overriding the default admin requires the custom admin site not to be in admin.pyOverriding the default admin requires the custom admin site not to be in admin.py.

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.

Version 0, edited 5 years ago by Mariusz Felisiak (next)
Note: See TracTickets for help on using tickets.
Back to Top