How to send Json or “dict” using Django Messages Framework
问题 I'm using Django Messaging framework to send additional data on the validation error: def clean_X(self): xuser_id = self.cleaned_data['xuser_id'] if xuser.objects.filter(xuser_id=xuser_id).exists(): available_now = {"available" : ["example","hello","ahc","sdcsd"]} messages.error(self.request, message = available_now,extra_tags="available_ids") raise forms.ValidationError('Sorry! User ID "%(xuser_id)s" is already taken, Please try another or chose one from following:', params={"xuser_id" :