patterns = resolver.reverse_dict.getlist(view_name)
kwargs = []
for possibility, pattern, defaults in patterns:
    for result, params in possibility:
        kwargs.append(params)
return kwargs
Django - get names of parameters needed to reverse url