Created
February 12, 2017 17:40
-
-
Save AliYmn/4b55fb262b450ae1a75b471ac051db9a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.http import HttpResponse | |
from django.utils.deprecation import MiddlewareMixin | |
class SimpleMiddleware(MiddlewareMixin): | |
def process_request(self, request): | |
pass | |
def process_response(self, request, response): | |
if(not request.path == "/"): | |
return HttpResponse("User : {}".format(request.user)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment