Django: decorator for catching response context from classic views -


i have simple classic django view:

@log_me def single(request):     item = items.objects.all()[0]     return render_to_response('ololo.html', {'object': item}) 

how can catch context in @log_me decorator? need this: {'object': item}

thank you.

this isn't possible. render_to_response render template context , return completed httpresponse object. httpresponse object available in view decorator context data rendered response.

you'll need think of approach. custom middleware may option, take @ process_template_response.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -