Quick Colab Setup Yields Production-Like Admin

Install Django 5.0+, Unfold, and Pillow via pip, then generate a fresh project with a 'shop' app. Configure settings for Colab: ALLOWED_HOSTS='*', CSRF_TRUSTED_ORIGINS for proxies, SQLite DB. Unfold config customizes SITE_TITLE='Acme Shop Admin', primary color scheme (e.g., 50:'250 245 255' to 950:'59 7 100'), and sidebar with sections like Overview (Dashboard, Users), Catalog (Categories with products_badge callback showing active count, Products), Sales (Orders, Customers). Add TABS for products/categories. Set DASHBOARD_CALLBACK and ENVIRONMENT to shop.utils functions. URLs redirect root to /admin/, serve media. This 1-file settings.py enables modern theme, search sidebar, no all-apps clutter—ready in <1 min, avoids port conflicts by killing old servers.

E-commerce Models with Actionable Fields and Logic

Define Category (name, slug, parent self-FK, is_active), Customer (name, email unique, tier choices: bronze/silver/gold/platinum, lifetime_value Decimal), Product (category FK, name, sku unique, description, price/stock Decimal/Int, status choices: draft/active/archived, featured bool, has_discount toggles discount_percent, final_price property applies discount), Order (number unique, customer PROTECT FK, status choices: pending/paid/shipped/delivered/cancelled, total/notes), OrderItem inline (order/product FKs, quantity/unit_price/position). Utils include environment_callback returning 'Development','warning', products_badge counting active Products, dashboard_callback aggregating KPIs: active products count, pending orders count, customers count, 30-day revenue from paid/shipped/delivered Orders Sum('total'); plus top 5 categories by product Count, orders by status Count. These fields enable real filtering/sorting (e.g., stock badges: out=0 danger, <10 low warning, else ok success; price strikethrough on discount).

Admin Customizations Boost Usability and Workflow

Extend unfold.admin.ModelAdmin: Category list_display name/parent/active/created_at, filters is_active ChoicesDropdownFilter, prepopulate slug, search name/slug. Customer: tier MultipleChoicesDropdownFilter (labels: bronze warning/silver info/gold success/platinum primary), lifetime_value/joined Range filters, warn_unsaved_form, list_per_page=25. Product: editable featured, filters status/category/price/featured, autocomplete category, conditional_fields discount_percent on has_discount==true, fieldsets tabbed (Basics/Pricing/Content), displays: status labels (draft info/active success/archived warning), price_display with strikethrough/discounted bold, stock_badge ordered by stock. Order: autocomplete customer, OrderItemInline tabbed/position-ordered extra=0, fieldsets tabbed Order/Notes, readonly created_at, actions: bulk mark_pending→paid (updates queryset, messages count), row mark-paid (url_path, redirect referer), detail duplicate_order (pk=None, number+COPY, status=pending), save_and_ship inline button. Filters/search per model, list_filter_submit compresses UI. Unregisters/re-registers User/Group. Results: intuitive CRUD with visual cues, bulk ops reduce clicks 5x for payments.

Seeded Dashboard Delivers Instant Insights

Migrate, seed: admin/admin superuser, 6 categories (Electronics sub Phones), 30 products (random category/status/price/stock/featured), 15 customers (random tier/value), 40 orders (1-4 random items, computed total). Custom admin/index.html extends base: grid KPI cards (title/value/footer styled), top_cats list (name/n), by_status list (status/capitalized/c). Launch runserver 0.0.0.0:8000, Colab proxyPort(8000)/admin/. Trade-off: Colab ephemeral (re-run for fresh), but reproducible script <300 lines beats manual setup; Unfold shines for internal tools but skips full auth/UI beyond admin.