How to set up custom middleware in Django
First: The path structure If you don’t have it you need to create the middleware folder within your app following the structure: yourproject/yourapp/middleware The folder middleware should be placed in the same folder as settings.py, urls, templates… Important: Don’t forget to create the init.py empty file inside the middleware folder so your app recognizes this … Read more