Setting middlewares and template context procerssors