Re: New-style middleware

2016-11-23 Thread Torsten Bronger
Hallöchen! Carl Meyer writes: > [...] > > Yes, I agree with you that for middleware which don't implement > request or response processing (only process_exception, > process_view, or process_template_response), the new style is less > concise, because it requires implementing a boilerplate

Re: New-style middleware

2016-11-22 Thread Carl Meyer
Hi Torsten, I worked on the design and implementation of new-style middleware. On 11/22/2016 01:30 PM, Torsten Bronger wrote: > Hallöchen! > > Considering the following old-style middleware class: > > class ExceptionsMiddleware: > def process_exception(self,

New-style middleware

2016-11-22 Thread Torsten Bronger
Hallöchen! Considering the following old-style middleware class: class ExceptionsMiddleware: def process_exception(self, request, exception): ... I convert this to new-style middleware by inserting two methods: class ExceptionsMiddleware: def __init__(self