django-management-ui
Run any Django management command from the admin panel. No models, no migrations — just install and go.
The app introspects argparse definitions of your commands and dynamically builds forms with appropriate widgets: text inputs, checkboxes, dropdowns, number fields, file uploads for Path arguments.
Features
- Automatic discovery of all registered management commands
- Dynamic form generation from argparse argument types
- File upload with temp file lifecycle for
Patharguments (upload or enter path as text) - Grouped display: command-specific args + collapsible BaseCommand options
- Output capture (stdout/stderr) with execution time
- Superuser-only access
- Appears on the Django Admin index page in the app list as "Commands" section
- Command blacklist to hide dangerous commands
- Configurable execution timeout (default 30s)
- Output truncation for large command outputs
Quick start
1. Install
pip install django-management-ui
2. Add to INSTALLED_APPS
INSTALLED_APPS = [
...
"management_ui",
]
3. Add URL configuration
# urls.py
from django.contrib import admin
from django.urls import include, path
urlpatterns = [
path("admin/", include("management_ui.urls")),
path("admin/", admin.site.urls),
]
That's it. Navigate to /admin/commands/ to see all available commands.
How it works
argparse introspection → ArgumentInfo → Django form field → execute command → CommandResult
- Discovery — finds all registered management commands via
django.core.management.get_commands() - Introspection — parses argparse
_actionsintoArgumentInfodataclasses - Form generation — maps argument types to Django form fields:
| Argument type | Form field |
|---|---|
store_true / store_false |
BooleanField (checkbox) |
choices |
ChoiceField (dropdown) |
type=int |
IntegerField |
type=float |
FloatField |
type=Path |
PathField (file upload + text input toggle) |
default / type=str |
CharField |
- Execution — runs command via
call_command(), captures stdout/stderr, measures duration - Result — displays output with success/error styling
Path argument support
When a command argument has type=Path, the form renders a dual-mode widget:
- File upload mode (default) — upload a file, it's saved to
/tmp/with a unique name, path passed to command, temp file cleaned up after execution - Text path mode — enter a server path as text (toggle via "or enter path as text" link)
Requirements
- Python >= 3.11
- Django >= 4.2
License
MIT
Metadata
Release files for django-management-ui 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django_management_ui-0.4.1.tar.gz | 544.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_management_ui-0.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 573.1 kB
Release files / django_management_ui-0.4.1.tar.gz
| Download URL | django_management_ui-0.4.1.tar.gz |
|---|---|
| Size | 544.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
32a666f5a65c8dfa3d799d7f38ac3f8567b40e920112ed0089ee8cbc7e122ac3
|
|
BLAKE2b-256 checksum How to use checksums |
71d8f94a522728db7013939bf15b76b5fc7286e5bbdee50efbd2b6a30a068426
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / django_management_ui-0.4.1-py3-none-any.whl
| Download URL | django_management_ui-0.4.1-py3-none-any.whl |
|---|---|
| Size | 28.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
afb663cf24e064e8caa1950b182a7c30f734e3f0c7e2b3d2cded037b407d3fb8
|
|
BLAKE2b-256 checksum How to use checksums |
53da409327ccbdfea4406c1e1194b0e8a43cf3a0af971872b143b2373767b666
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|