I\'m writing a django management command to handle some of our redis caching. Basically, I need to choose all keys, that confirm to a certain pattern (for example: \"prefix:
From the Documentation
delete(*names) Delete one or more keys specified by names
This just wants an argument per key to delete and then it will tell you how many of them were found and deleted.
In the case of your code above I believe you can just do:
redis.delete(*x)
But I will admit I am new to python and I just do:
deleted_count = redis.delete('key1', 'key2')