问题描述
优点和缺点?
我个人为我的django项目使用buildout,但考虑到简单的切换到virtualenv + pip。
I'm personally using buildout for my django projects but thinking of switching to virtualenv + pip for its simplicity.
推荐答案
在核心,buildout和pip + virtualenv也是一样的。他们都使用python包,安装它们,将它们与其余的python环境隔离开来,处理依赖关系(通过setup.py)等等。
At the core, buildout and pip+virtualenv do the same. They both use python packages, install them, isolate them from the rest of your python environment, handle dependencies (through setup.py) and so on.
Buildout做的更多。自然而然,这意味着比点更多的配置。你必须弄清楚额外的配置是否值得你从中获得回报的努力。
Buildout does more. Which, naturally, means a bit more configuration than with pip. You'll have to figure out whether the extra configuration is worth the effort for what you get back from it.
有些附加功能可以从一个几个附加组件(食谱):
Some of the extras you can get out of buildout with a couple of add-ons ("recipes"):
-
为您设置django的'djangorecipe'插件。例如,不需要指向您的settings.py文件的环境变量。
The 'djangorecipe' addon that sets up django for you. No need for that environment variable that points at your settings.py file, for instance. Handy.
自动设置cronjob。
Automatically setting up a cronjob.
生成配置文件apache一个为您的网站)从一个模板。使用您的buildout配置中的变量,所以这样可以防止重复。
Generating config files (like an apache one for your site) from a template. Uses variables from your buildout config, so this prevents duplication.
基本上,您可以获得一些显式配置使用buildout完成。更少的手动步骤。
Basically, you can get some explicit configuration done with buildout. Fewer manual steps.
另一方面,您可以使用其他工具来实现您可能需要的额外级别的自动化。所以virtualenv + pip + something_else也是一种可能。
On the other hand, you can use other tools for that extra level of automation that you probably need. So virtualenv+pip+something_else is also a possibility.
这篇关于django的buildout vs virtualenv + pip?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!