1

I am trying to achieve something like this:

def AppAView(request)
     myData = Process(request)
     return myRedirect(url/to/AppBView, myData) # I want to pass myData to AppBView for 
                                                # further process

def AppBView(request)
     myData = Process(request)
     FurtherProcess(myData)
     return render(request, template[myData])

AppAView and AppBView potentially can be on different servers. What would be the best practice or at least a good/safe way of doing this in Django without explicitly passing myData as part of the url?

Thank you

Kappa
  • 1,015
  • 1
  • 16
  • 31
hagh
  • 507
  • 5
  • 13
  • 2
    try http://stackoverflow.com/questions/1463489/how-do-i-pass-template-context-information-when-using-httpresponseredirect-in-dj (look at the second answer with more votes.. not the answer which is ticked off) – SilentDev Jul 22 '14 at 06:14
  • That answer uses HttpResponseRedirect(url) which redirects user to url, but I want to redirect the request to another server for further process. – hagh Jul 23 '14 at 13:21

1 Answers1

0

It would probably use Sessions for that:

  1. In AppAView, save mydata to request.session['mydata']
  2. Redirect to AppBView
  3. In AppBView check if request.session['mydata'] exists, if so further process it.

The challenging part would then be the cross-server session store and access. I found this gist which has a possible solution for a shared session store.

toabi
  • 3,986
  • 1
  • 24
  • 24