django-subdomains icon indicating copy to clipboard operation
django-subdomains copied to clipboard

Exception occurred processing WSGI script :: ImportError: No module named 'subdomains'

Open adarshdeep-kamboj opened this issue 8 years ago • 1 comments

I am running an app in apache2 with wsgi, but I am getting this error:

mod_wsgi (pid=26904): Exception occurred processing WSGI script '/var/www/multidb/multidb/wsgi.py'. Traceback (most recent call last): File "/usr/lib/python3/dist-packages/django/core/handlers/wsgi.py", line 170, in call self.load_middleware() File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 50, in load_middleware mw_class = import_string(middleware_path) File "/usr/lib/python3/dist-packages/django/utils/module_loading.py", line 26, in import_string module = import_module(module_path) File "/usr/lib/python3.5/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 986, in _gcd_import File "", line 969, in _find_and_load File "", line 944, in _find_and_load_unlocked File "", line 222, in _call_with_frames_removed File "", line 986, in _gcd_import File "", line 969, in _find_and_load File "", line 956, in _find_and_load_unlocked ImportError: No module named 'subdomains'

this is my middleware:

MIDDLEWARE_CLASSES = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'subdomains.middleware.SubdomainURLRoutingMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ]

I have installed django-subdomains using pip, and it's available in site-packages.

adarshdeep-kamboj avatar Jul 09 '16 20:07 adarshdeep-kamboj

@adarshdeep-kamboj stackoverflow is better for such type of questions. I suppose, that you've installed django-subdomains for python2, but tried to import it from python3.

prokaktus avatar Jul 11 '16 11:07 prokaktus