Django remote deployment with buildout and Fabric

自闭症网瘾萝莉.ら 提交于 2019-12-11 11:42:51

问题


I am writing a web application using Django, on djangorecipe. I wanted to have an automatic deployment and found out that Fabric would be a perfect solution.

I am not sure though, how do you use Fabric in buildout environment. It turned out that the buildout recipes and posts on using Fabric are a bit outdated (ca. 2010). Has anyone tried implementing that?


回答1:


Best way to think about it is to treat them as separate.

  • Buildout is for setting everything up, both locally and on the server. Grabbing django and all needed python packages. Perhaps even generate an apache config file from a template.

  • fabric is for running remote commands, like checking out your tag with buildout in it on the server, running bootstrap and buildout and for restarting apache for instance.

Buildout manages the actual directory. Fabric runs buildout and manages everything outside of the buildout dir. Works like a charm!

(And of course you put your fabfile.py inside your buildout dir. And you can add fabric itself to a zc.recipe.egg:scripts part to get a local bin/fab in case you prefer that.)



来源:https://stackoverflow.com/questions/10113805/django-remote-deployment-with-buildout-and-fabric

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