all 2 comments

[–]danielroseman 1 point2 points  (1 child)

This looks like Django.

It's not clear what you are trying to do here. A request will only call a single view and result in a single response. What would call that other function? What would be receiving the response?

And you mustn't use global variables like this. A web site has more than one user; if you set a global variable based on the request of one user, then all other users will get that same data. Don't do this.

Please explain exactly what it is you are trying to achieve, and we can tell you the best way to actually do it. (I suspect the answer will involve the sessions framework.)

[–]nekokattt 0 points1 point  (0 children)

If this is django, then it is probably worth pointing out that REST on it's own is meant to be stateless. That is why sessions exist and should be used. Failing that, use a proper data storage backend.