如何使建筑增加鸡蛋到艺术品

时间:2022-02-18 01:01:09

I have to work with few django projects that uses virtualenv (and that is fine). Except its quite hard to get this virtual setup every time I want to develop something.

我必须使用一些使用virtualenv的django项目(这很好)。但是每次我想要开发一些东西时都很难得到这个虚拟设置。

So I'd like to use zc.buildout, it would solve easy environment construction issue. Unfortunately I must not break old virtualenv way of developing/deploying.

我想用zc。它可以解决简单的环境建设问题。不幸的是,我不能打破旧的开发/部署虚拟环境的方式。

Projects heavily rely on manage.py file.

项目严重依赖管理。py文件。

/project_root
|-- virtual
|-- website
    |-- manage.py (has to access all python packages that buildout installs)
    `-- ...

Basically I need buildout to install eggs to virtual/lib/python/site_packages folder, best would be to symlink form egg cache.

基本上,我需要buildout将鸡蛋安装到virtual/lib/python/site_packages文件夹中,最好是将鸡蛋缓存与符号链接在一起。

Notes:

注:

  1. buildout generates django executable script that contains all required paths. This script gets installed into virtual/bin/.
  2. buildout生成django可执行脚本,该脚本包含所有必需的路径。这个脚本被安装到virtual/bin/中。
  3. I've tried gp.recipe.pip, but it doesn't seem to do what I need.
  4. 我试着gp.recipe。匹普,但它似乎不能满足我的需要。
  5. I haven't tried rjm.recipe.venv yet
  6. 我还没有试过rjm.recipe。venv然而

Solution

Its not perfect, but works:

它并不完美,但很管用:

  1. collect eggs to one folder using collective.recipe.omelette.
  2. 收集鸡蛋到一个文件夹使用集体。收到。煎蛋卷。
  3. add __init__.py file to this folder using cp.recipe.cmd (thanks to sureshvv).
  4. 添加__init__。使用cp.recipe将py文件发送到此文件夹。cmd(由于sureshvv)。
  5. append path to this folder in required python files (in my case its manage.py).
  6. 在所需的python文件(在我的例子中是它的manageed .py)中向该文件夹追加路径。

1 个解决方案

#1


1  

You can use cp.recipe.cmd and run the easy_install command with the --install-dir optiion

您可以使用cp.recipe。使用——install-dir optiion运行easy_install命令

#1


1  

You can use cp.recipe.cmd and run the easy_install command with the --install-dir optiion

您可以使用cp.recipe。使用——install-dir optiion运行easy_install命令