WebFaction
Community site: login faq

Frustrating problem here... after hours of debugging various problems transitioning my application to webfaction's servers, I'm finally ready to start my server, and... my heart just sank upon seeing "500 SERVER ERROR" in big black font. Checking the logs, the error is:

[Thu Aug 11 17:05:46 2011] [error] [client 127.0.0.1] mod_wsgi (pid=2807): Exception occurred processing WSGI script '/home/germanjoey/webapps/django/mysite.wsgi'.
[Thu Aug 11 17:05:46 2011] [error] [client 127.0.0.1] Traceback (most recent call last):
[Thu Aug 11 17:05:46 2011] [error] [client 127.0.0.1]   File "/home/germanjoey/webapps/django/lib/python2.7/django/core/handlers/wsgi.py", line 250, in __call__
[Thu Aug 11 17:05:46 2011] [error] [client 127.0.0.1]     self.load_middleware()
[Thu Aug 11 17:05:46 2011] [error] [client 127.0.0.1]   File "/home/germanjoey/webapps/django/lib/python2.7/django/core/handlers/base.py", line 47, in load_middleware
[Thu Aug 11 17:05:46 2011] [error] [client 127.0.0.1]     raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e))
[Thu Aug 11 17:05:46 2011] [error] [client 127.0.0.1] ImproperlyConfigured: Error importing middleware djangobb_forum.middleware: "No module named djangobb_forum.middleware"

Hmmm, I think... on a hunch, I change the line in settings.py to instead use "mysite.djangobb_forum.middlware", and that gets me a new error:

[Thu Aug 11 17:13:12 2011] [error] [client 127.0.0.1] mod_wsgi (pid=4176): Exception occurred processing WSGI script '/home/germanjoey/webapps/django/mysite.wsgi'.
[Thu Aug 11 17:13:12 2011] [error] [client 127.0.0.1] Traceback (most recent call last):
[Thu Aug 11 17:13:12 2011] [error] [client 127.0.0.1]   File "/home/germanjoey/webapps/django/lib/python2.7/django/core/handlers/wsgi.py", line 250, in __call__
[Thu Aug 11 17:13:12 2011] [error] [client 127.0.0.1]     self.load_middleware()
[Thu Aug 11 17:13:12 2011] [error] [client 127.0.0.1]   File "/home/germanjoey/webapps/django/lib/python2.7/django/core/handlers/base.py", line 47, in load_middleware
[Thu Aug 11 17:13:12 2011] [error] [client 127.0.0.1]     raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e))
[Thu Aug 11 17:13:12 2011] [error] [client 127.0.0.1] ImproperlyConfigured: Error importing middleware mysite.djangobb_forum.middleware: "No module named djangobb_forum.subscription"

The error of course being that it cannot load a module from within the middleware file it can now find, because it needs to be "mysite.djangobb_forum.subscription" instead of "djangobb_forum.subscription."

This is awful! There's no way I can go and change my hundreds and hundreds of imports around like this! Even if I could, it would break my testing setup on my laptop. Is there way I can set the system path up, or something, so that django can find my modules? I feel like I'm so close here!

This question is marked "community wiki".

asked 11 Aug '11, 16:30

germanjoey
526
accept rate: 0%


Check you apache config file for WSGIPythonPath directive and make sure all the valid paths are there, editing the strings that define what is a valid path is much easier than changing the code, and this is a common issue when moving from local to deploy as path info will always be different on 2 different OSes and environments.

permanent link

answered 11 Aug '11, 18:14

johns
5.4k312
accept rate: 23%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×27
×19
×15
×2

question asked: 11 Aug '11, 16:30

question was seen: 3,556 times

last updated: 11 Aug '11, 18:14

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM