json - 序列化文本块 django rest-framework 并使用 react 显示段落
问题描述
我正在创建一个博客并使用 djangorestframework 作为我的后端并为我的前端做出反应。当我序列化我的数据时,我丢失了我的博客条目的格式(以段落形式编写)。有没有办法来解决这个问题。
所以:
博客文章
This is my blog post, and this is my formatting.
My second paragraph.
变成。
[{
"title": "blog post",
content: "This is my blog post, and this is my formatting My second paragraph."
}
]
当我通过我的反应时它仍然存在
This is my blog post, and this is my formatting My second paragraph.
解决方案
推荐阅读
- python-3.x - 在 pandas 数据框列中查找月末
- tensorflow - CUDA 10.0 和 10.1 可以在同一个系统上吗?
- c - 在编译期间将扩展的宏打印到文件中
- python - 如何在 Python 中将经过的时间字符串转换为秒
- mongodb - Gitlab CI中的Mongodb连接
- javascript - 如何通过 Sequelize 连接多个数据库?
- sql - 在 SQL Server 2008 中存储为图像数据类型的长文本的关键字搜索
- javascript - React 递归函数以渲染组件
- php - 使 nginx 在子目录中与 symfony 一起工作时遇到问题
- google-chrome - 为什么我的预检请求在 Firefox 中使用 axios 制作的 http DELETE 请求返回 400?