[Fixed]-Request input from django custom command?

21👍

Use the built-in raw_input() function:

def handle(self, *args, **options):
    if args:
        ids = args
    else:
        ids = raw_input('Enter comma-delimited list of ids: ').split(',')
    for client_id in ids:
        ...

Edit: In Python3, use input() instead of raw_input()

Leave a comment