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.0.tar.gz (4.6 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.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dbbasic_admin-0.1.0.tar.gz
  • Upload date:
  • Size: 4.6 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.0.tar.gz
Algorithm Hash digest
SHA256 1243f17863559645aad5f58e8498e9d6393e793933f88236452347d534bf54d7
MD5 7c9ff077e88176effd3bc313902251e7
BLAKE2b-256 144c52cf0602fde57dfa8491b66d9c4eb8fd29cf1004d70c4bddeadaa65fb7b6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dbbasic_admin-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2a40634ccbf583b9e33f7e3f72db6e40604e7336a7b13c5af2bd31a2ce9e7946
MD5 6191f8c9796fbce36db1e0393bd2cf13
BLAKE2b-256 8eadbbe50ffdad53da92f1a2ae00324f29451368555e24ed12ca328474809c92

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