Buildout vs virtualenv + pip for django?

女生的网名这么多〃 提交于 2019-12-21 03:51:23

问题


Pros and cons?

I'm personally using buildout for my django projects but thinking of switching to virtualenv + pip for its simplicity.


回答1:


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 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"):

  • 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.

  • Automatically setting up a cronjob.

  • Generating config files (like an apache one for your site) from a template. Uses variables from your buildout config, so this prevents duplication.

Basically, you can get some explicit configuration done with 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.



来源:https://stackoverflow.com/questions/6865896/buildout-vs-virtualenv-pip-for-django

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!