基于 Django 的网站的好方法,如果需要安装先决条件
考虑使用 python 和 django 构建网站。在许多情况下,它使用标准 python 库旁边的第 3 方模块 - 例如 pytz、South、时区或调试工具栏。
将此类应用程序部署到生产托管并自动安装所有先决条件(时区等)的标准或便捷方法是什么?
我是 python 新手,如果这个问题很蹩脚,我很抱歉。
Consider a website build using python and django. In many cases it uses 3rd party modules beside standard python library - such as pytz, South, timezones or debug toolbar.
What is standard or just convenient way to deploy such application to production hosting with all the prerequisites (timezones, etc) installed automatically?
I'm new to python, and sorry if this question is lame.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
至少有两种选择。 Django 联合创始人之一 Jacob Kaplan-Moss 写过关于使用
buildout
和djangorecipe
。还有多功能的fabric
。您应该能够单独使用其中任何一个或与一些自定义脚本结合使用来解决您的问题。There are at least two options available. Jacob Kaplan-Moss, one of the co founders of Django has written about packaging an application using
buildout
anddjangorecipe
. There is also the versatilefabric
. You should be able to tackle your problem using either of these alone or in combination with some custom scripts.Fabric 绝对是实现这一目标的好方法。在 http://www.caktusgroup.com/blog/2010/04/22/basic-django-deployment-with-virtualenv-fabric-pip-and-rsync/。
Fabric 的关键是“fabfile.py” - 有一个在 http://bitbucket.org/copelco/caktus-deployment/src/tip/example-django-project/caktus_website/fabfile.py。
我用来部署到 Linode 实例的变体是 http://gist.github.com/ 556508
Fabric is definitely a nice way to accomplish this. There is a fairly extensive blog write up on the process at http://www.caktusgroup.com/blog/2010/04/22/basic-django-deployment-with-virtualenv-fabric-pip-and-rsync/.
The key to fabric is "fabfile.py" - there's an example of one that does a deployment at http://bitbucket.org/copelco/caktus-deployment/src/tip/example-django-project/caktus_website/fabfile.py.
The variation of this that I've used to deploy to a Linode instance is http://gist.github.com/556508
您可以使用 Fabric (http://fabfile.org/) 等部署解决方案,也可以尝试打包整个事情都变成了一个带有依赖项的Python Egg,当你
easy_install
它时,它会自动安装。请参阅 http://mxm-mad-science .blogspot.com/2008/02/python-eggs-simple-introduction.html 简单介绍了 python Eggs。You can either use a deployment solution like fabric (http://fabfile.org/) or you can try to package the entire thing up into a python egg with dependencies that will be automatically installed when you
easy_install
it. See http://mxm-mad-science.blogspot.com/2008/02/python-eggs-simple-introduction.html for a simple introduction to python eggs.