Django如何将多个页面的表单数据存储到一张表中

发布于 2024-12-29 23:11:27 字数 233 浏览 1 评论 0原文

我正在构建一个 django 项目,并创建用户配置文件应用程序。但我希望用户在多个页面中完成创建个人资料过程。例如:第一页填写地址和电话号码,然后用户单击“继续”进入第二页,用户可以在第二页填写其他一些信息,例如性别、出生日期。但我想将所有这些信息存储到一张表中。

我以前所做的是将第一页的数据存储到某个隐藏字段中,然后传递到下一页并在最后一页提交它们。这是正确且安全的方法吗? django 如何处理这种情况?

谢谢。

I'm building a django project, and creating user profile app. But I want user to complete creating profile process in multiple pages. For example: first page fill in the address and phone number, and then user click "continue" to the second page, where user can fill in some other things like gender, date of birth. But I want to store all this information into one table.

What I used to do is store the first page's data into some hidden field, and pass to the next page and submit them at the final page. Is that the correct and secure way? How django handle this condition?

Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

十二 2025-01-05 23:11:27

使用 Django 的 FormWizard

Use Django's FormWizard

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文