简体   繁体   English

对于django,Buildout vs virtualenv + pip?

[英]Buildout vs virtualenv + pip for django?

Pros and cons? 优点和缺点?

I'm personally using buildout for my django projects but thinking of switching to virtualenv + pip for its simplicity. 我个人正在为我的django项目使用buildout,但考虑到简单地切换到virtualenv + pip。

At the core, buildout and pip+virtualenv do the same. 核心,buildout和pip + virtualenv也是如此。 They both use python packages, install them, isolate them from the rest of your python environment, handle dependencies (through setup.py) and so on. 它们都使用python包,安装它们,将它们与python环境的其余部分隔离开来,处理依赖项(通过setup.py)等等。

Buildout does more. Buildout做得更多。 Which, naturally, means a bit more configuration than with pip. 当然,这意味着比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"): 你可以通过一些附加组件(“配方”)从buildout中获得一些额外的东西:

  • The 'djangorecipe' addon that sets up django for you. 'djangorecipe'插件为你设置django。 No need for that environment variable that points at your settings.py file, for instance. 例如,不需要指向settings.py文件的环境变量。 Handy. 便利。

  • Automatically setting up a cronjob. 自动设置cronjob。

  • Generating config files (like an apache one for your site) from a template. 从模板生成配置文件(如您网站的apache)。 Uses variables from your buildout config, so this prevents duplication. 使用buildout配置中的变量,这样可以防止重复。

Basically, you can get some explicit configuration done with buildout. 基本上,您可以使用buildout完成一些显式配置 Fewer manual steps. 更少的手动步骤。

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. 所以virtualenv + pip + something_else也是可能的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM