How to create admin model views and stand-alone pages (...)
summary
Shows how to add real admin pages and modelless admin-like pages using only Django core: a markdown preview page and a dumpdata output in a textarea that captures dumpdata via StringIO and has worked for years. Uses extend admin base_site.html, override ModelAdmin.get_urls and admin_view for auth, or register standalone URLs with staff_member_required/permission_required and never_cache. Crucial detail: call admin.each_context and supply title, opts (model._meta), module_name copied from admin options.py history view templates. Code lives on Codeberg/GitHub.
AI-written summary · about
chapters (13)
- 0:00Introduction and speaker background
- 1:03Why love Django admin
- 3:30Reverse engineering Django admin
- 4:34Model admin vs non-model admin pages
- 7:02Authentication and permissions
- 9:50Context data essentials
- 12:19Template and HTML structure
- 15:56Live demo setup
- 16:40Custom admin page examples
- 21:42Base views for custom pages
- 25:13Reverse engineering admin options.py
- 29:26Summary and resources
- 30:50Q&A session
