Apache Improperlyconfigured Error Importing Middleware
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site django error importing middleware About Us Learn more about Stack Overflow the company Business Learn more about no module named security hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up ImproperlyConfigured: Error importing middleware - Django wsgi error Apache up vote 0 down vote favorite I have a Python Django site in one of my AWS Linux Server. First of all, let me tell you what I have done to host my Django app on my server. By default, the server has been installed with Python 2.6.9. For my application, I have compiled and installed Python 2.7.6 in a different location(/opt/python2.7.6). Still, the default python is 2.6.9. My application is under a virtual environment which has been created against this newly installed Python(2.7.6). My Web server is Apache2 (Version 2.4) and installed WSGI module by compiling the same against Python 2.7.6 using the below command. ./configure --with-python=/opt/python2.7.6/bin/python I have configured apache accordingly and I am getting the following error. Kindly advice me how to resolve this issue. [Mon Mar 21 10:38:32.669216 2016] [:info] [pid 26256] mod_wsgi (pid=26256): Create interpreter 'www.example.com|'. [Mon Mar 21 10:38:32.671113 2016] [:info] [pid 26256] mod_wsgi (pid=26256): Adding '/home/testuser/example.com' to path. [Mon Mar 21 10:38:32.671607 2016] [:info] [pid 26256] mod_wsgi (pid=26256): Adding '/home/testuser/venv/lib/python2.7/site-packages' to path. [Mon Mar 21 10:38:32.672621 2016] [:info] [pid 26256] mod_wsgi (pid=26256): Adding '/home/testuser/example.com/example' to path. [Mon Mar 21 10:38:32.681871 2016] [:info] [pid 26256] [client x.x.x.x:46626] mod_wsgi (pid=26256, process='www.example.com', application='www.example.com|'): Loading WSGI script '/home/testuser/example.com/example/wsgi.py'. [Mon Mar 21 06:38:33.341024 2016] [:error] [pid 26256] [client x.x.x.x:46626] mod_wsgi (pid=26256): Exception occurred processing WSGI script '/home/testuser/example.com/example/wsgi.py'. [Mon Mar 21 06:38:33.341297 2016] [:error] [pid 26256] [client x.x.x.x:46626] Traceback (most recent call last): [Mon Mar 21 06:38:33.341478 2016] [:error] [pid 26256] [client x.x.x.x:46626] File "/home/testuser/venv/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 236, in __call__ [Mon Mar 21 06:38:33.341772 2016
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, http://stackoverflow.com/questions/36129828/improperlyconfigured-error-importing-middleware-django-wsgi-error-apache helping each other. Join them; it only takes a minute: Sign up ImproperlyConfigured: Error importing middleware django.middleware.user up vote 0 down vote favorite I have just installed django-cms with pip install, and now, when I try to access the admin page, am getting the following error with no luck with using other solutions to this problem (many http://stackoverflow.com/questions/21107282/improperlyconfigured-error-importing-middleware-django-middleware-user that involved changing path variable) for the past few hours Traceback (most recent call last): File "/usr/lib/python2.6/site-packages/flup- 1.0.3.dev_20110405- py2.6.egg/flup/server/fcgi_base.py", line 574, in run protocolStatus, appStatus = self.server.handler(self) File "/usr/lib/python2.6/site-packages/flup-1.0.3.dev_20110405-py2.6.egg/flup/server/fcgi_base.py", line 1159, in handler result = self.application(environ, start_response) File "/home/mcgillme/lib/python2.6.6/site-packages/Django-1.4.10-py2.6.egg/django/core/handlers/wsgi.py", line 219, in __call__ self.load_middleware() File "/home/mcgillme/lib/python2.6.6/site-packages/Django-1.4.10-py2.6.egg/django/core/handlers/base.py", line 47, in load_middleware raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e)) ImproperlyConfigured: Error importing middleware django.middleware.page: "No module named page" Status: 500 Internal Server Error Content-Type: text/html I looked through other solutions, so I checked my cms installation - the folder middleware exists and contains an _init.py file. $PATH and $PYTHONPATH seem to include the cms as well, because, for example this works: Python 2.6.6 (r266:84292, Nov 22 2013, 12:16:22) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import cms >>> import django.middleware >>> import django.middleware.page Traceback (most recent call last): File "
Start here for a quick overview of the site Help Center Detailed answers to any http://serverfault.com/questions/646555/error-importing-middleware-on-osqa questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Server Fault Questions Tags Users Badges Unanswered Ask Question _ Server Fault is a question and answer site for error importing system and network administrators. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top “Error importing middleware” on osqa up vote 1 down vote favorite I installed osqa with postgresql as error importing middleware backend on ubuntu 14.0.4 using the tutorial below http://wiki.osqa.net/display/docs/ubuntu+12.04,+django+1.3,+mod_wsgi,+virtual_env,+postgresql which asks to create a virtual environment. I did the same and was getting 500 server error. Hence, I set the debug = True in settings_local.py and got the following error in the apache error log file showing mod_wsgi errors. [Mon Nov 24 11:26:33.823663 2014] [:error] [pid 6389:tid 3034110784] [remote 192.168.227.129:15031] mod_wsgi (pid=6389): Exception occurred processing WSGI script '/srv/osqa.1/osqa/osqa.wsgi'. [Mon Nov 24 11:26:33.823844 2014] [:error] [pid 6389:tid 3034110784] [remote 192.168.227.129:15031] Traceback (most recent call last): [Mon Nov 24 11:26:33.823882 2014] [:error] [pid 6389:tid 3034110784] [remote 192.168.227.129:15031] File "/srv/osqa.1/lib/python2.7/site-packages/Django-1.3-py2.7.egg/django/core/handlers/wsgi.py", line 250, in __call__ [Mon Nov 24 11:26:33.824027 2014] [:error] [pid 6389:tid 3034110784] [remote 192.168.227.129:15031] self.load_middleware() [Mon Nov 24 11:26:33.824059 2014] [:error] [pid 6389:tid 3034110784] [remote 192.168.227.129:15031] File "/srv/osqa.1/lib/python2.7/site-packages/Django-1.3-py2.7.egg/django/core/handlers/base.py", line 47, in load_middleware [Mon Nov 24 11:26:33.824184 2014] [:error] [pid 6389:tid 3034110784] [remote 192.168.227.129:15031] raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e)) [Mon Nov 24 11:26:33.824216 2014] [:error] [p