Re: middleware question
I did some test myself and the best thing what I can do is to attach
data to the request since its live cycle is what I actually need.
Best regards,
Marcin
On 14:20 Sat 25 May , Marcin Szamotulski wrote:
> Dear Django Gurus,
>
> I have a simple question about middleware. I have a middleware object
> which looks like this:
>
>
> class MyMiddleware(object):
>
> def process_view(...):
>
> ...
> self.data = some data
> ...
>
>
> def process_template_response(...):
>
> data = self.data
> del self.data
>
> ...
>
> It works fine when I test it myself, but the question is what is a life
> cycle of middleware objects. Will this work when there is a big
> traffic? So the question is if middleware objects are instantiated for
> every request and then garbage collected?
>
>
> Best regards,
> Marcin Szamotulski
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home