Skip to main content

Auto-discovery admin interface for dbbasic modules

Project description

dbbasic-admin

Auto-discovery admin interface for dbbasic modules.

Philosophy

Admin interfaces should auto-generate from installed modules, not require manual configuration.

Features

  • Auto-discovery - Installing a dbbasic module automatically adds its admin panels
  • Zero configuration - Modules just need admin.py and templates/admin/
  • Filesystem routing - Admin routes follow file paths (like CGI/PHP)
  • Dynamic sidebar - Built from core + discovered modules
  • Auto-CRUD - Generates admin UI for TSV tables
  • Search & filters - Built-in for all tables

Installation

pip install dbbasic-admin

Quick Start

1. Install dbbasic-admin

pip install dbbasic-admin

2. Access Admin Interface

http://localhost:8000/admin/

That's it! The admin interface is ready.

3. Install Modules with Admin Panels

pip install dbbasic-blog

The "Posts" tab automatically appears in the admin sidebar.

Creating a Module with Admin

1. Export ADMIN_CONFIG

# your_module/admin.py
ADMIN_CONFIG = [
    {
        "icon": "📝",
        "label": "Posts",
        "href": "/admin/posts",
        "order": 20,
        "table": "posts",  # Auto-generates CRUD
    }
]

2. Create Templates (Optional)

For custom admin pages:

your_module/
└── templates/
    └── admin/
        └── posts/
            ├── list.html    # /admin/posts/list
            ├── new.html     # /admin/posts/new
            └── [id].html    # /admin/posts/123

3. Install Your Module

pip install your-module

Your admin tab appears automatically!

How It Works

  1. Auto-discovery - Scans installed dbbasic_* packages
  2. Finds ADMIN_CONFIG - Loads nav items from each module's admin.py
  3. Builds sidebar - Combines core + module nav items
  4. Filesystem routing - Uses dbbasic-web's routing for admin pages

Core Admin Pages

  • Dashboard - System overview, quick actions
  • Code - File browser and editor
  • Database - TSV table browser
  • Jobs - Background job queue
  • Logs - System and application logs
  • Settings - Configuration management

ADMIN_CONFIG Reference

ADMIN_CONFIG = [
    {
        # Required
        'label': 'Posts',           # Display name
        'href': '/admin/posts',     # URL path

        # Optional
        'icon': '📝',              # Emoji or icon class
        'order': 20,               # Sort order (0-99)
        'badge': '3',              # Notification badge
        'table': 'posts',          # Auto-generate CRUD
        'fields': {...},           # Field configuration for CRUD
    }
]

Documentation

Full specification: https://dbbasic.com/admin-spec

License

MIT

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbbasic_admin-0.1.1.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dbbasic_admin-0.1.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file dbbasic_admin-0.1.1.tar.gz.

File metadata

  • Download URL: dbbasic_admin-0.1.1.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.1

File hashes

Hashes for dbbasic_admin-0.1.1.tar.gz
Algorithm Hash digest
SHA256 baa47f3dd29f0251825d3e8f906f138e28d0333d2fba72491b4d7d8f953f5089
MD5 356f49a33bfb26582e75ce65e41e4c4c
BLAKE2b-256 4df63abdf0afc1a672ee8ae42845a99d9e42be9a7d00f2c6cd8e542c7ec0b637

See more details on using hashes here.

File details

Details for the file dbbasic_admin-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: dbbasic_admin-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.1

File hashes

Hashes for dbbasic_admin-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f2771ebf2d0a6090045f20e7456634f16db9a5977e18dd1384c248ebda7c857b
MD5 59f237264e535120b28e1dc8691a2e22
BLAKE2b-256 5bb02627e5c2648553fb50fe03f85b326a9280e4ac689234eae78b1b77fb5b2f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page