passing arguments to management.call_command on a django view [duplicate]

Django

This question already has answers here: Change script run from commandline to django view (2 answers) Closed 7 years ago.I have a command i run from the command line that takes two arguments,-tzusb and -e.I have converted this so that it is called on a django view.I have a little glitch though,How do i pass this arguments to the management.call_command function I have in my views?here is my view for that

def tzusbcsv(request):    management.call_command('artifact\_db\_loader','artefacts')    return render_to_response('html/upload.html')

Answer link : https://codehunter.cc/a/django/passing-arguments-to-management-call-command-on-a-django-view-duplicate

Posted May 4, 2022, 6:43 PM UTC

10
Loading comments…