Python django:在视图之间传递表单数据

Python django:在视图之间传递表单数据,python,django,django-forms,httpwebrequest,django-views,Python,Django,Django Forms,Httpwebrequest,Django Views,我有一个看法: class SomeView(FormView): form_class = SomeForm template_name = 'app/template.html' def get(self, request, *args, **kwargs): form = self.form_class return render(request, self.template_name, {form:'form'}) de

我有一个看法:

class SomeView(FormView):
    form_class = SomeForm
    template_name = 'app/template.html'

    def get(self, request, *args, **kwargs):
        form = self.form_class
        return render(request, self.template_name, {form:'form'})

    def post(self, request, *args, **kwargs):
        form = self.form_class(request.POST)
        if form.is_Valid():
        #do something here
        return HttpResponseRedirect("Go somewhere from here after processing")
post
中,我需要进行一个API调用,该调用从该表单获取数据。但是,我想将用户重定向到另一个视图,在那里他可以查看表单中的所有数据并说
confirm

提交此
确认
视图时,我应该实际进行此API调用

如何将表单数据传递到另一个视图?我可以简单地将表单数据存储在dict中并从URL传递,但这可能会在浏览器级别暴露一些关键数据

有没有更安全的方法


谢谢

是的,django有一个litle助手: