API Reference¶
Auto-generated documentation from source code docstrings.
Registry¶
| Symbol | Description |
|---|---|
register_command |
Decorator to register a management command with the admin runner |
Context¶
| Symbol | Description |
|---|---|
is_admin_runner |
Return True during an admin-runner command execution |
set_result_html |
Store HTML as the rich result for the current execution |
Forms¶
| Symbol | Description |
|---|---|
FileOrPathField |
Form field accepting an uploaded file or a server-side path |
FileOrPathWidget |
Widget with file-upload and text-path inputs side by side |
FileField |
File-upload-only field |
ImageField |
Image-upload-only field (requires Pillow) |
form_from_command |
Build a Django Form class from a command's argparse parser |
Hooks¶
| Symbol | Description |
|---|---|
CommandHook |
Base class for command execution hooks |
HookContext |
Dict-like state bag scoped to a single command execution |
TempFileHook |
Creates a unique upload directory and removes it after execution |
Runners¶
| Symbol | Description |
|---|---|
BaseCommandRunner |
Abstract base class for command runners |
RunResult |
Data class returned by runner run() implementations |
SyncCommandRunner |
Runs commands inline in the current thread |
DjangoTaskRunner |
Enqueues commands using Django's built-in task system |
CeleryCommandRunner |
Enqueues commands as Celery tasks |
get_runner |
Instantiate the runner configured by ADMIN_RUNNER_BACKEND |
Models¶
| Symbol | Description |
|---|---|
CommandExecution |
Model storing the results of command executions |
RegisteredCommand |
Model storing registered commands and their metadata |
Admin¶
| Symbol | Description |
|---|---|
CommandRunnerModelAdminMixin |
Mixin for ModelAdmin to add "Run" links for attached commands |