From c35f0db869c43153d5fc1a0db96ae0d88fc22003 Mon Sep 17 00:00:00 2001 From: Seth Ladygo Date: Tue, 12 Mar 2019 23:03:49 -0700 Subject: [PATCH] docco for middleware --- procat2/middleware.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/procat2/middleware.py b/procat2/middleware.py index 4b8ed1d..db47004 100644 --- a/procat2/middleware.py +++ b/procat2/middleware.py @@ -1,7 +1,18 @@ -# https://docs.djangoproject.com/en/2.1/topics/http/middleware/ -# https://stackoverflow.com/questions/12596722/django-identify-app-in-template +""" +Middleware classes used throughout the project. + +See https://docs.djangoproject.com/en/2.1/topics/http/middleware/ +""" class SetApplicationName(object): + """ + Set request.current_app to the name of the app the current + view belongs to. This ends up being the first component + of the package name. + + See: + https://stackoverflow.com/questions/12596722/django-identify-app-in-template + """ def __init__(self, get_response): self.get_response = get_response