4
我用django + wsgi構建了一個很好的開發和生產工具。唯一的問題是,當我對buildout.cfg進行更改或添加並且必須運行bin/buildout時,網站將從buildout開始到結束時間離線。這可能需要5分鐘以上。部署到生產,建立和停機時間最短?
有沒有辦法在生產中正常運行buildout?也許我不知道這個參數會運行構建,而不先卸載所有內容?此網站正在一個Web服務器上運行。負載均衡器和額外的Web服務器將是一個不錯的解決方案,但在這一點上不可行。
歡迎對我的構建腳本提出任何其他意見/建議/批評。
謝謝!
這裏是我的buildout.cfg:
[buildout]
download-cache = downloads
unzip = true
parts =
scripts
django
djangoprod
eggs =
${scripts:eggs}
${pipscripts:eggs}
[scripts]
recipe = zc.recipe.egg
unzip = true
download-cache = ${buildout:download-cache}
eggs =
ipython
docutils
feedparser
pygments
South
django-grappelli
django-extensions
django-mobile
django-photologue
django-filebrowser
django-indexer
django-paging
django-templatetag-sugar
django-sentry
MySQL-python
find-links =
http://dist.repoze.org/
http://github.com/
http://bitbucket.org/
http://googlecode.com/
http://surfnet.dl.sourceforge.net/
[pipscripts]
recipe = gp.recipe.pip
unzip = true
download-cache = ${buildout:download-cache}
editables =
hg+https://bitbucket.org/ubernostrum/django-registration#egg=django_registration
git://github.com/jtauber/django-mailer.git#egg=django_mailer
eggs =
django-registration
django-mailer
PIL
install =
http://effbot.org/downloads/Imaging-1.1.7.tar.gz
[django]
recipe = djangorecipe
download-cache = ${buildout:download-cache}
eggs = ${buildout:eggs}
version = 1.3
project = project
[djangoprod]
recipe = djangorecipe
download-cache = ${django:download-cache}
version = ${django:version}
settings = production
wsgi = true
eggs = ${django:eggs}
project = ${django:project}
優秀!這正是我所期待的! – 2011-05-24 15:27:14