Satchmo integration with existing django project

I have a working django project and I want to integrate Satchmo with this project. The problem is that instead of putting satchmo in the directory of my package site, I want it to be used as a django application, i.e. all satchmo applications, such as product, shipping, satchmo-utils, etc., should be in a directory, such as satchmo-apps in my django project. But doing this, I get an error message that was not detected by any module: satchmo_utils or something else in satchmo applications. And I don't want to put satchmo applications (product, shipping, tax, etc.) directly in the python / django path. so please help me.

+3
source share
1 answer

You want to say you don’t want to add it to the PYTHONPATH environment variable?

If so, you can have the parent directory in which you installed Satchmo added to the python module search path at runtime so that it only applies to your project. Say you have a Satchmo package copied to your project directory as follows:

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

You can then use the following at the beginning settings.pyto get Python to find it:

import sys
import os
sys.path.insert(0, os.path.dirname(__file__))
+2
source

Source: https://habr.com/ru/post/1709756/


All Articles