将 Satchmo 与现有 django 项目集成
我有一个正在运行的 django 项目,我想将 Satchmo 与该项目集成。 问题是,我不想将 satchmo 放入我的 site-packages 目录中,而是希望将其用作 django 应用程序,即所有 satchmo 应用程序(如产品、运输、satchmo-utils 等)都位于我的目录中的 satchmo-apps 目录中Django 项目。 但是通过这样做,我得到一个错误,没有找到模块:satchmo_utils 或 satchmo-apps 中的任何内容。 我不想将 satchmo 应用程序(产品、运输、税务等)直接放入 python/django 路径中。 所以请帮帮我。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的意思是您不想将其添加到 PYTHONPATH 环境变量中吗?
如果是这样,您可以在运行时将安装 Satchmo 的父目录添加到 python 模块搜索路径中,以便它仅适用于您的项目。
假设您已将 Satchmo 包复制到项目目录中,如下所示:
然后您可以在
settings.py
的开头使用以下内容让 Python 找到它: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:
Then you can use the following at the start of your
settings.py
to make Python find it: