About Calling a Management Command from a Function
You can call a Django management command from another management command, a background task, a function, or a method using call_command
function:
from django.core.management import call_command
call_command("run_steps", "--steps=1", "--verbosity=0")
Tips and Tricks Programming Dev Ops Django 4.2 Django 3.2 Django 2.2 Python 3
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django GDPR Cookie Consent app
For Django websites that use cookies.