使用 git 时,pinax 中的代码和环境分离

发布于 2025-01-02 21:21:00 字数 580 浏览 4 评论 0原文

我有一个用 django 和 pinax 编写的有点大的项目。目前,我将整个 virtualenv 和我的源代码树保存在同一个 git 存储库中;然而,这变得非常笨拙,我希望将环境与源代码分开,因为坦率地说,它变得非常难以管理。我只发现 Git 和客户端/服务器代码分离 不适用对我来说,因为我的问题是将环境与源头分开。是否有一种特定的方法(目录布局)与 virtualenv 一起使用,可以保持环境独立?例如

./env
./src

,当前 virtualenv 的默认设置是当前

./env
./env/project/

我使用第二种布局,并将所有 env 和源放在单个 git 存储库中,这就是我需要更改的内容。

第一个布局的问题是路径不起作用并且模块引发 ImportError。这看起来像是一个外观问题,但对我来说非常烦人。使用 git 时将 virtualenv 与源代码分离的过程是什么?

I have a somewhat large project written in django and pinax. Currently I keep then entire virtualenv and my source tree in the same git repository; however, this is becoming very unwieldy I would like to keep the environment separate from the source code as frankly it is becoming very hard to manage. I have only found Git and client/server code separation which doesn't apply to me, since my question is about separating the environment from the source. Is there a specific way, directory layout, to use with virtualenv that can keep the environment separate? For example

./env
./src

Currently the default for virtualenv is to have

./env
./env/project/

Currently I use the second layout, and have all the env and source in a single git repository, this is what I need to change.

The problem with the first layout is that path's don't work and modules raise ImportError. This might seem like a cosmetic issue, but is very annoying to me. What is the procedure for separating virtualenv from the source code while using git.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文