I got this error when integrating this library with the Django Rest Framework. I was following this guide. But after adding this section to my setting.py file, I got the above error.
MIDDLEWARE = [
# other middleware
'django_multitenant.middleware.MultitenantMiddleware',
]
I wasted a lot of time rechecking and reinstalling the project ensuring everything was done as outlined by the documentation. However, there was a minor spelling mistake in the documentation itself. The middlewares module is shown as middleware in the docs that I discovered after checking the source code.
Solution
MIDDLEWARE = [
# other middleware
# Add the missing 's' to middleware
'django_multitenant.middlewares.MultitenantMiddleware',
]
Problem
I got this error when integrating this library with the Django Rest Framework. I was following this guide. But after adding this section to my
setting.py
file, I got the above error.I wasted a lot of time rechecking and reinstalling the project ensuring everything was done as outlined by the documentation. However, there was a minor spelling mistake in the documentation itself. The
middlewares
module is shown asmiddleware
in the docs that I discovered after checking the source code.Solution