views:

110

answers:

1

I'm installing Django on Bluehost and one of the steps to install it was to install flup on their server. I did so and everything works great when I'm logged in via the SSH. However when I actually hit the page in my browser it can't find flup. I get this error in the server log:

ERROR: No module named flup. Unable to load the flup package. In order to run django as a FastCGI application, you will need to get flup from http://www.saddi.com/software/flup/ If you've already installed flup, then make sure you have it in your PYTHONPATH.

Since it recognizes flup when I'm in the SSH my best guess is that there's some other bash file I need to change to get PYTHONPATH pointing to the right places for the http request. But since it's a shared server I don't have a whole lot of privileges outside of my home directory.

Any ideas?

+2  A: 

If you can identify what module exactly is trying to import flup, you can prepend that import with a sys.path.append of the path to which you have installed flup -- as long as the sys.path.append happens before the import flup, you're in clover.

Alex Martelli
I'm calling the append function in my fcgi file. Would this be sufficient or would I need to locate the django file that calls flup and manually change it there?
Adam
If you're still getting the error, then you're not doing the append early enough (and you may indeed have to identify -- and, sigh, modify -- a django [[or other]] module that does get loaded before the error occurs).
Alex Martelli
Sounds fine. Useful for frobbing the path: `site.addsitedir`.
bobince
Awesome. Got it working. Thanks!
Adam
@Adam, glad to hear this -- you're welcome! @bobince, good tip, esp. if there are `.pth` files involved.
Alex Martelli