citusdata / citusdata/django-multitenant

ModuleNotFoundError: No module named 'django_multitenant.middleware'

Open
#208 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
823
Forks
126
PR merge metrics
No merged PRs in 30d

Description

## Problem

I got this error when integrating this library with the Django Rest Framework. I was following [this](https://django-multitenant.readthedocs.io/en/latest/django_rest_integration.html) guide. But after adding this section to my `setting.py` file, I got the above error.
```python
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
```python
MIDDLEWARE = [
# other middleware
# Add the missing 's' to middleware
'django_multitenant.middlewares.MultitenantMiddleware',
]
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.