Error Importing Middleware Reviewboard.admin.middleware
från GoogleLogga inDolda fältSök efter grupper eller meddelanden
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, helping each other. Join them; it only takes https://groups.google.com/d/topic/reviewboard/34v0dv2jOdM a minute: Sign up Django apache-wsgi configuration problem up vote 2 down vote favorite I am trying to get my Django project running on the production server. I setup the environment using pip, so it is identical to the development environment where everything is running fine. The only difference is that I don't use virtualenv on production, because this project is the http://stackoverflow.com/questions/3061502/django-apache-wsgi-configuration-problem only one that is going to run on production. Also on production, there is an Nginx reverse proxy to serve static content, and passes dynamic requests to Apache2. The Apache wsgi file is as follows: import sys, os sys.path.append('/home/project/src') os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() When I access the server, I get an import error: ImproperlyConfigured: Error importing middleware middleware: "cannot import name UserProfile" Which refers to the middleware.py under src/ folder which is referred by the settings. But I can import both the middleware and the UserProfile class from within ./manage.py shell prompt. It seems like a problem with paths in wsgi file but I cannot see what. The directory structure is: /home/project /home/project/src (which contains the settings.py, middleware.py and app folders) /home/apache/apache.wsgi Any help is greatly appreciated. Thanks, oMat django apache wsgi pip share|improve this question asked Jun 17 '10 at 12:15 omat 2,02732148 1 how does your installed apps looks like? try adding "/home/project/" to your sys path –Prashanth Jun 17 '10 at 12:22 try adding the path where you've typed django-admin.py ... –deostrol
Board Student Sonar Splat All Opened Closed 2490: After installation in Windows Server 2003, reviewboard can not run!!! ThirdParty Review Board Priority: Medium Type: Defect https://hellosplat.com/s/beanbag/tickets/2490/ Reported by: bruc****@gmai***** (Google Code) (Is this you? Claim this profile.) 4 years, http://pastie.org/pastes/5477618 7 months Unassigned Closed: Feb. 17, 2012 What version are you running? 1.6.3 What's the URL of the page containing the problem? I don't know, maybe index What steps will reproduce the problem? 1.Install the rb site 2.Access localhost/site 3.Display error page What is the expected output? What do you error importing see instead? Mainpage, maybe login. I can only see default error page What operating system are you using? What browser? Windows Server 2003, Chrome Please provide any additional information below. I use wsgi as CGI in apache, and I find the error log as: mod_wsgi (pid=2248): Exception occurred processing WSGI script 'E:/ReviewBoard/code/htdocs/reviewboard.wsgi'. [Fri Feb 17 09:29:00 2012] [error] [client 192.168.1.2] Traceback (most error importing middleware recent call last): [Fri Feb 17 09:29:00 2012] [error] [client 192.168.1.2] File "C:\\Python27\\lib\\site-packages\\django-1.3.1-py2.7.egg\\django\\core\\handlers\\wsgi.py", line 250, in __call__ [Fri Feb 17 09:29:00 2012] [error] [client 192.168.1.2] self.load_middleware() [Fri Feb 17 09:29:00 2012] [error] [client 192.168.1.2] File "C:\\Python27\\lib\\site-packages\\django-1.3.1-py2.7.egg\\django\\core\\handlers\\base.py", line 47, in load_middleware [Fri Feb 17 09:29:00 2012] [error] [client 192.168.1.2] raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e)) [Fri Feb 17 09:29:00 2012] [error] [client 192.168.1.2] ImproperlyConfigured: Error importing middleware reviewboard.admin.middleware: "DLL load failed: \xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb6\xa8\xb5\xc4\xc4\xa3\xbf\xe9\xa1\xa3" I tried to find solution in Google. someone said the problem is PyCrypto. But when I want to rebuild it by using MinGW, some error display such as chome error. So I am not sure PyCrypto is the key point. So any body meet this situation and find solution ? Thanks. A painful python user in Windows -_-!!! #1 david We're not able to support installation of pycrypto, especially on Windows. You'll have to contact the pycrypto developers for help with this. Status: +ThirdParty #2 bruc****@gmai***** (Google Code) (Is this you? Claim this profile.) So you sure that the problem is based on PyCrypto???? raise exceptions.ImproperlyConfigured('Error importing
Blackboard Brilliance Black Cobalt Espresso Libre IDLE Mac Classic MagicWB (Amiga) Pastels on Dark Slate Slush and Poppies Sunburst Sunburst (Josh) Twilight Vibrant Ink Done Unwrap text Validating models... 0 errors found Django version 1.4.2, using settings 'reviewboard.settings' Development server is running at http://0.0.0.0:8080/ Quit the server with CONTROL-C. Traceback (most recent call last): File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run self.result = application(self.environ, self.start_response) File "/home/user/envs/reviewboard/local/lib/python2.7/site-packages/Django-1.4.2-py2.7.egg/django/core/handlers/wsgi.py", line 219, in __call__ self.load_middleware() File "/home/user/envs/reviewboard/local/lib/python2.7/site-packages/Django-1.4.2-py2.7.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 reviewboard.admin.middleware: "No module named cache" [03/Dec/2012 22:50:09] "GET / HTTP/1.1" 500 59 Traceback (most recent call last): File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run self.result = application(self.environ, self.start_response) File "/home/user/envs/reviewboard/local/lib/python2.7/site-packages/Django-1.4.2-py2.7.egg/django/core/handlers/wsgi.py", line 219, in __call__ self.load_middleware() File "/home/user/envs/reviewboard/local/lib/python2.7/site-packages/Django-1.4.2-py2.7.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 reviewboard.admin.middleware: "No module named cache" Traceback (most recent call last): File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run self.result = application(self.environ, self.start_response) File "/home/user/envs/reviewboard/local/lib/python2.7/site-packages/Django-1.4.2-py2.7.egg/django/core/handlers/wsgi.py", line 219, in __call__ self.load_middleware() File "/home/user/envs/reviewbo