Используйте json_script


django mtv