tags:

views:

433

answers:

1

I have a running django project and i want to integrate Satchmo with that project. Problem is that instead of putting satchmo into my site-packages directory, i want it to be used as a django app i.e all the satchmo apps like product, shipping, satchmo-utils etc are to be in a directory say satchmo-apps in my django project. But by doing this i get an error that no module found: satchmo_utils or whatever is within the satchmo-apps. And i don't want to put the satchmo apps(product, shipping,tax etc) directly into the python/django path. so please help me out.

+1  A: 

Do you mean you don't want to add it to the PYTHONPATH environment variable?

If so, you could have the parent directory of where you have Satchmo installed added to the python module search path at runtime, so that it applies to your project only. Say you have the Satchmo package copied to your project directory like this:

project/
 +-settings.py
 +-satchmo/
     +-apps/
     +-projects/
     +-static/

Then you can use the following at the start of your settings.py to make Python find it:

import sys
import os
sys.path.insert(0, os.path.dirname(__file__))
Steef