Closed salmanqureshi closed 5 years ago
Hey @salmanqureshi, with this commit I fixed it and pushed a new release in pypi repository. Could be that you have an older release, could you try to uninstall and reinstall the library.
I installed the package a few hours before reporting the issue. And see the version installed as 1.0.2. The commit you referred to is actually 1.0.1 and the line added to init.py is what I had to fix.
At the moment init.py and django_multitenant.py are at the same level. Should the plugin code have been inside a directory?
Looks like this is happening with python 2.x version. With python 3.6 it doesn't because I guess it recursively picking up the library via the high level django_multitenant folder.
One thing you could try is keep the same init.py and have something as below in the files you want to use the library:
import django_multitenant
from django_multitenant import *
No luck. I'll go ahead with editing the module init file for now.
Issue resolved in this - https://github.com/mehta/django-multitenant
Hi @mehta, @salmanqureshi, I wanted to let you know that a new version of django_multitenant was released which could also be solving the issue that you had :)
New to Python/Django and only reporting this because I am not sure if there's something wrong with my setup or just how the plugin/package is packaged/distributed.
I have a virtual environment with .. python 2.7 and django 1.11
Installed the package using 'pip install django_multitenant', but ran into an ImportError because of the line "from django_multitenant.django_multitenant import *", which wasn't in my code. I had to refactor the init.py and remove the redundant django_multitenant from the import to fix this.
Is this the right approach? Or is there a distribution available with the fix? I don't want everyone in the team to have to do this.