Django如何将多个页面的表单数据存储到一张表中
我正在构建一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 Django 的 FormWizard
Use Django's FormWizard