我有一个 django + wsgi 的构建,它在开发和生产上运行良好。唯一的问题是,当我对 buildout.cfg 进行更改或添加并且必须运行 bin/buildout 时,网站会从 buildout 开始到完成时离线。这可能需要 5 分钟以上。
有没有办法在生产中优雅地运行构建?也许我不知道的一个参数会在不先卸载所有东西的情况下运行构建?该站点在一台 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}