if not hasattr(sys, 'arg_set'):
    args = [arg for arg in sys.argv[1:] if arg[:6] == '--set=']
if len(args) > 0:
    expr = args[0][6:]
sys.argv.remove(args[0])
Django: how to pass individual setting to manage.py